Enhydra 5.1 API

org.enhydra.tool.codegen
Class ProjectGenerator

java.lang.Object
  |
  +--org.enhydra.tool.codegen.TemplateDrivenGenerator
        |
        +--org.enhydra.tool.codegen.ProjectGenerator
All Implemented Interfaces:
Constants, java.util.EventListener, Generator, TemplateListener
Direct Known Subclasses:
AppGenerator, ServiceGenerator

public abstract class ProjectGenerator
extends TemplateDrivenGenerator
implements Constants


Field Summary
 
Fields inherited from class org.enhydra.tool.codegen.TemplateDrivenGenerator
res
 
Fields inherited from interface org.enhydra.tool.codegen.Constants
CLIENT_SUFFIX, CONTENT_HTML, CONTENT_WML, DIR_AT_PACKAGE_DIR_AT, DIR_INPUT, DIR_LIB, DIR_MEDIA, DIR_OUTPUT, DIR_PRESENTATION, DIR_RESOURCES, DIR_SRC, DIR_TEMPLATE, DIR_TOOL, FILE_BUILD_XML, FILE_ENHYDRA_JAR, FILE_MAKEFILE, FILE_README_HTML, FILE_RUN_BAT_IN, FILE_RUN_IN, SYS_JAVA_VENDOR, SYS_JAVA_VERSION, SYS_USER_HOME, TAB4, TYPE_BAT, TYPE_CONF, TYPE_HTML, TYPE_IN, TYPE_JAVA, TYPE_MK, TYPE_TEMPLATE, TYPE_WML, TYPE_XML, XMLC_DEFAULT, XMLC_SUFFIX
 
Constructor Summary
ProjectGenerator()
           
 
Method Summary
 TemplateFilter createCopyFilter(TemplateTool tool)
           
 Replacement[] createReplacementsForDirectory(PathHandle path)
          Method declaration
 TemplateFilter createTemplateFilter(TemplateTool tool)
           
 java.io.File[] generate()
          Generate application files from a set of templates.
 java.lang.String[] getAddinSteps()
          Get steps required to build the project with the an IDE Addin.
protected abstract  java.lang.String[] getDefaultAddinSteps()
           
protected abstract  java.lang.String[] getDefaultShellSteps()
           
 java.lang.String getDestination()
           
 java.lang.String getJavaPath()
           
 java.lang.String[] getOutputExcludes()
           
 java.lang.String getProjectSourcePath()
          Get the path where Java source files were generated.
 java.lang.String[] getShellSteps()
          Get steps required to build the project from a unix shell.
 void initReplacementSet()
          Method declaration
 void onTemplate(TemplateEvent event)
           
 void setAddinSteps(java.lang.String[] steps)
          Set the steps required to build the project from within an IDE.
 void setJavaPath(java.lang.String p)
           
 void setProperties(java.util.Properties p)
          Set CodeGen customization properties.
 void setShellSteps(java.lang.String[] steps)
          Set the steps required to build the project from a unix shell.
 void storeProperties()
          Method declaration
 
Methods inherited from class org.enhydra.tool.codegen.TemplateDrivenGenerator
getInputIncludes, getOptionSet, getProperties, getReplacementSet, getTemplateRoot, isEcho, isOverwrite, isSwing, setEcho, setOptionSet, setOverwrite, setReplacementSet, setSwing, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.enhydra.tool.codegen.Generator
getCommandName, getDescription, getDisplayName, getWizardPanels, getWizardTitle
 

Constructor Detail

ProjectGenerator

public ProjectGenerator()
Method Detail

getOutputExcludes

public java.lang.String[] getOutputExcludes()

generate

public java.io.File[] generate()
                        throws GeneratorException
Description copied from class: TemplateDrivenGenerator
Generate application files from a set of templates. This implementation of the generate method uses the replacements array to perform a search and replace on generated file names as well as there contents.

Specified by:
generate in interface Generator
Overrides:
generate in class TemplateDrivenGenerator
Returns:
An array of the files that were generated.
GeneratorException

storeProperties

public void storeProperties()
Description copied from class: TemplateDrivenGenerator
Method declaration

Overrides:
storeProperties in class TemplateDrivenGenerator

setProperties

public void setProperties(java.util.Properties p)
                   throws GeneratorException
Description copied from class: TemplateDrivenGenerator
Set CodeGen customization properties. The CodeGen class calls this method after it instantiates a generator class.

Specified by:
setProperties in interface Generator
Overrides:
setProperties in class TemplateDrivenGenerator
GeneratorException

createCopyFilter

public TemplateFilter createCopyFilter(TemplateTool tool)
                                throws GeneratorException
Specified by:
createCopyFilter in class TemplateDrivenGenerator
GeneratorException

createTemplateFilter

public TemplateFilter createTemplateFilter(TemplateTool tool)
                                    throws GeneratorException
Specified by:
createTemplateFilter in class TemplateDrivenGenerator
GeneratorException

getDestination

public java.lang.String getDestination()
                                throws GeneratorException
Specified by:
getDestination in class TemplateDrivenGenerator
GeneratorException

setJavaPath

public void setJavaPath(java.lang.String p)

getJavaPath

public java.lang.String getJavaPath()

setShellSteps

public void setShellSteps(java.lang.String[] steps)
Set the steps required to build the project from a unix shell.

Specified by:
setShellSteps in interface Generator
Parameters:
steps - An array of strings, each string will be inserted into a readme.html file as numbered step for building the project from a unix shell.

getShellSteps

public java.lang.String[] getShellSteps()
Get steps required to build the project from a unix shell.

Specified by:
getShellSteps in interface Generator
Returns:
An array of strings, each string will be inserted into a readme.html file as numbered step for building the project using make files.

getAddinSteps

public java.lang.String[] getAddinSteps()
Get steps required to build the project with the an IDE Addin.

Specified by:
getAddinSteps in interface Generator
Returns:
An array of strings, each string will be inserted into a readme.html file as numbered step for building the project within an IDE.

setAddinSteps

public void setAddinSteps(java.lang.String[] steps)
Set the steps required to build the project from within an IDE.

Specified by:
setAddinSteps in interface Generator
Parameters:
steps - An array of strings, each string will be inserted into a readme.html file as numbered step for building the project within an IDE.

getProjectSourcePath

public java.lang.String getProjectSourcePath()
                                      throws GeneratorException
Get the path where Java source files were generated.

Returns:
The java source directory.
GeneratorException

initReplacementSet

public void initReplacementSet()
                        throws GeneratorException
Method declaration

Specified by:
initReplacementSet in class TemplateDrivenGenerator
Throws:
GeneratorException

onTemplate

public void onTemplate(TemplateEvent event)
Specified by:
onTemplate in interface TemplateListener

getDefaultShellSteps

protected abstract java.lang.String[] getDefaultShellSteps()

getDefaultAddinSteps

protected abstract java.lang.String[] getDefaultAddinSteps()

createReplacementsForDirectory

public Replacement[] createReplacementsForDirectory(PathHandle path)
                                             throws GeneratorException
Method declaration

Specified by:
createReplacementsForDirectory in class TemplateDrivenGenerator
Throws:
GeneratorException

Enhydra 5.1 API