Enhydra 5.1 API

org.enhydra.tool.codegen
Interface Generator

All Known Implementing Classes:
TemplateDrivenGenerator

public interface Generator

Interface for defining generators. CodeGen can use any generator that implements this interface, is in the class path and has an entry in the codegen.properties file.


Method Summary
 java.io.File[] generate()
          Try the generating the application and return a list
 java.lang.String[] getAddinSteps()
          Get steps required to build the project with an IDE addin.
 java.lang.String getCommandName()
          Get short name used in command line.
 java.lang.String getDescription()
          Get text that breifly explains the application that the generator creates.
 java.lang.String getDisplayName()
          Name to display in command line messages and in the wizard.
 OptionSet getOptionSet()
          Get an array of generator options that can be set through command line options or through wizard panels.
 java.util.Properties getProperties()
          Get properties used to customize CodeGen.
 java.lang.String[] getShellSteps()
          Get steps required to build the project from a unix shell.
 CodeGenPanel[] getWizardPanels()
          Get swing panels for setting generator options.
 java.lang.String getWizardTitle()
          Name to display in command line messages and in the wizard.
 boolean isEcho()
           
 boolean isSwing()
           
 void setAddinSteps(java.lang.String[] steps)
          Set the steps required to build the project from within an IDE.
 void setEcho(boolean b)
           
 void setProperties(java.util.Properties properties)
          Set CodeGen customization properties.
 void setShellSteps(java.lang.String[] steps)
          Set the steps required to build the project from a unix shell.
 void setSwing(boolean b)
           
 

Method Detail

setProperties

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

Parameters:
properties - Properties passed from the CodeGen class.
GeneratorException

getProperties

public java.util.Properties getProperties()
Get properties used to customize CodeGen. This may contain information on the template directory location and persisted generation options.

Returns:
Properties passed from the CodeGen class.

getCommandName

public java.lang.String getCommandName()
Get short name used in command line. May also be used to locate template directory.

Returns:
Command line identifier.

getDisplayName

public java.lang.String getDisplayName()
Name to display in command line messages and in the wizard.

Returns:
Display name for generator.

getWizardTitle

public java.lang.String getWizardTitle()
Name to display in command line messages and in the wizard.

Returns:
Display name for generator.

getDescription

public java.lang.String getDescription()
Get text that breifly explains the application that the generator creates.

Returns:
Descriptive text to display in a wizard or in a command line help response.

getOptionSet

public OptionSet getOptionSet()
Get an array of generator options that can be set through command line options or through wizard panels.

Returns:
An OptionSet that contains an array of GeneratorOptions.

getWizardPanels

public CodeGenPanel[] getWizardPanels()
                               throws GeneratorException
Get swing panels for setting generator options. The panels can be used within a standalone wizard or incorporated into the JBuilder wizard framework.

Returns:
An array of one or more JPanel based panels. Return null to specify that the wizard only supports a command line interface.
GeneratorException

generate

public java.io.File[] generate()
                        throws GeneratorException
Try the generating the application and return a list

Returns:
An array of the generated files.
Throws:
GeneratorException - Thrown if all the files could not be generated without error.

getAddinSteps

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

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.

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.

getShellSteps

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

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.

setShellSteps

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

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.

setEcho

public void setEcho(boolean b)

isEcho

public boolean isEcho()

setSwing

public void setSwing(boolean b)

isSwing

public boolean isSwing()

Enhydra 5.1 API