gate.creole
Class BootStrap

java.lang.Object
  |
  +--gate.creole.BootStrap

public class BootStrap
extends Object

This class creates a resource (e.g.ProcessingResource, VisualResource or Language Resource) with the information from the user and generates a project in the directory provided by the user


Constructor Summary
BootStrap()
           
 
Method Summary
 String addContent(String content, String expr, String interfaces)
          Modifies the content of the file from gate/resources/pathResourceFile using the information (e.g.name of the resource, name of the class which implements the resource)provided by the user and copies it in currentFile.
 String changeKeyValue(String text, Map map)
          Determines all the keys from the map "names" in the text and replaces them with their values
 Map createNames(String namePackage, String nameClass, String stringPackages)
          create the map with variants of the names...
 void createResource(String namePackage, String typeResource, String nameClass, Set listInterfaces, String pathNewProject)
          Creates the resource and dumps out a project structure using the structure from gate/resource/creole/templateproject/Template and the information provided by the user
 List determinePath(String namePackage)
          determines the name of the packages and adds them to a list
 String determineTypePackage(String text)
          return the text between the last dot and the end of input
 String getInterfacesAndClass(String typeResource, Set listInterfaces)
          returns all the interfaces that it implements and the class that it extends as a string
 String namesPackages(Set listPackages)
          determine all the packages
 String regularExpressions(String text, String replacement, String regEx)
          replace with replacement in the text using regEx as a regular expression
 void shapeMethod(List listMethodExtend, List listInterfacesMethod)
          create the form for the methods from the class that create the resource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootStrap

public BootStrap()
Method Detail

regularExpressions

public String regularExpressions(String text,
                                 String replacement,
                                 String regEx)
                          throws gnu.regexp.REException
replace with replacement in the text using regEx as a regular expression

changeKeyValue

public String changeKeyValue(String text,
                             Map map)
                      throws gnu.regexp.REException
Determines all the keys from the map "names" in the text and replaces them with their values

determineTypePackage

public String determineTypePackage(String text)
return the text between the last dot and the end of input

getInterfacesAndClass

public String getInterfacesAndClass(String typeResource,
                                    Set listInterfaces)
                             throws ClassNotFoundException
returns all the interfaces that it implements and the class that it extends as a string

shapeMethod

public void shapeMethod(List listMethodExtend,
                        List listInterfacesMethod)
create the form for the methods from the class that create the resource

addContent

public String addContent(String content,
                         String expr,
                         String interfaces)
                  throws gnu.regexp.REException
Modifies the content of the file from gate/resources/pathResourceFile using the information (e.g.name of the resource, name of the class which implements the resource)provided by the user and copies it in currentFile. This procedure also adds the interfaces that it implements and the class that it extends in the class which creates the resource

createNames

public Map createNames(String namePackage,
                       String nameClass,
                       String stringPackages)
create the map with variants of the names...

namesPackages

public String namesPackages(Set listPackages)
determine all the packages

determinePath

public List determinePath(String namePackage)
                   throws IOException
determines the name of the packages and adds them to a list

createResource

public void createResource(String namePackage,
                           String typeResource,
                           String nameClass,
                           Set listInterfaces,
                           String pathNewProject)
                    throws IOException,
                           ClassNotFoundException,
                           gnu.regexp.REException,
                           GateException
Creates the resource and dumps out a project structure using the structure from gate/resource/creole/templateproject/Template and the information provided by the user