public class BootStrap extends Object
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
allPackages
the packages used by the class which creates the resources
|
protected static int |
BUFF_SIZE
the size of the buffer
|
protected char[] |
cbuffer
a buffer in order to read an array of char
|
protected Map<Integer,String> |
fields
the enumeration of the variables from main class
|
protected List<String> |
listMethodsResource
the methods from the class that implements the resource
|
protected List<String> |
listPackages
the list with the packages name where the main class can be find
|
protected static String |
nameProject
the name of jar resource
|
protected Map<String,String> |
names
a map from the variants of the names of the files and the
directories of the empty project to the variants of the names of the
files and the directories the new project
|
protected static String |
newLine
new line for different platforms
|
protected Map<String,String> |
oldNames |
protected static String |
oldResource
the name of the resource of the template project from the gate resources
|
Constructor and Description |
---|
BootStrap() |
Modifier and Type | Method and Description |
---|---|
String |
changeKeyValue(String text,
Map<String,String> map)
Determines all the keys from the map "names" in the text and replaces them
with their values
|
Map<String,String> |
createNames(String packageName,
String resourceName,
String className,
String stringPackages,
String interfacesAndClass)
create the map with variants of the names...
|
void |
createResource(String resourceName,
String packageName,
String typeResource,
String className,
Set<String> interfacesList,
String pathNewProject)
Creates the resource and dumps out a project structure using the
structure from gate/resource/creole/bootstrap/Template and the
information provided by the user
|
List<String> |
determinePath(String packageName)
determines the name of the packages and adds them to a list
|
String |
determineTypePackage(String text)
determines the package of the main class
|
String |
displayMethodsAndFields(List<String> methods,
Map<Integer,String> fields)
write the methods and the fields in the right form
|
void |
executableFile(String nameFile) |
List<gate.creole.FeatureMethod> |
featuresClass(Class<?> currentClass,
List<gate.creole.FeatureMethod> methodsList)
go through all methods and determines return type, parameters, exceptions
|
String |
getInterfacesAndClass(String typeResource,
Set<String> interfacesList)
returns the string with the interfaces that implement the main class and
the class that extends it
|
void |
getMethodsAndFields(List<gate.creole.FeatureMethod> methodsExtendList,
List<gate.creole.FeatureMethod> methodsInterfacesList)
create the form for the methods from the class that create the resource
|
static void |
main(String[] args) |
String |
namesPackages(Set<String> listPackages)
determine all the packages
|
void |
verifyInput(String className,
String pathNewProject)
verify if the class name contains only letters and digits
the path of the new project is a directory
|
protected static final String oldResource
protected static final String nameProject
protected static final String newLine
protected Map<String,String> names
protected List<String> listMethodsResource
protected List<String> listPackages
protected Set<String> allPackages
protected char[] cbuffer
protected static final int BUFF_SIZE
public String changeKeyValue(String text, Map<String,String> map)
public String determineTypePackage(String text)
public String getInterfacesAndClass(String typeResource, Set<String> interfacesList) throws ClassNotFoundException
ClassNotFoundException
public List<gate.creole.FeatureMethod> featuresClass(Class<?> currentClass, List<gate.creole.FeatureMethod> methodsList)
public void getMethodsAndFields(List<gate.creole.FeatureMethod> methodsExtendList, List<gate.creole.FeatureMethod> methodsInterfacesList)
methodsExtendList
- is the list with all methods from the class that extends
the resourcemethodsInterfacesList
- is the list with all methods from the interfaces
that implement the resourcepublic String displayMethodsAndFields(List<String> methods, Map<Integer,String> fields)
public Map<String,String> createNames(String packageName, String resourceName, String className, String stringPackages, String interfacesAndClass)
public List<String> determinePath(String packageName) throws IOException
IOException
public void verifyInput(String className, String pathNewProject) throws GateException
GateException
public void executableFile(String nameFile) throws IOException, InterruptedException
IOException
InterruptedException
public void createResource(String resourceName, String packageName, String typeResource, String className, Set<String> interfacesList, String pathNewProject) throws IOException, ClassNotFoundException, GateException, InterruptedException
resourceName
- is the name of the resourcepackageName
- is the name of the new resourcetypeResource
- is the type of the resource (e.g.ProcessingResource,
LanguageResource or VisualResource)className
- is the name of the class which implements the resourceinterfacesList
- is the set of the interfaces that implements the resourcepathNewProject
- is the path where it will be the new resourceIOException
ClassNotFoundException
GateException
InterruptedException
public static void main(String[] args)
Copyright © 2024 GATE. All rights reserved.