org.jostraca
Class JostracaTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.jostraca.JostracaTask

public class JostracaTask
extends org.apache.tools.ant.Task

Jakarta Ant task for Jostraca.

Example:

    
      
    

    
        
    
 

The attribute configFile is not required.


Nested Class Summary
static class JostracaTask.Template
           
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
JostracaTask()
          Creates a new JostracaTask.
 
Method Summary
 void addTemplate(JostracaTask.Template pTemplate)
           
 void addText(java.lang.String pText)
           
 void execute()
          Calls Jostraca.main( String[] ) with the specified arguments.
 java.io.File getAdditionalConfigFile()
           
 boolean getBackup()
           
 java.io.File getBackupFolder()
           
 java.lang.String getClassPath()
           
 java.lang.String getClassPathDefine()
          Get define option.
 java.lang.String getClassPathPrefix()
           
 java.lang.String getClassPathPrefixDefine()
          Get define option.
 java.lang.String getClassPathSuffix()
           
 java.lang.String getClassPathSuffixDefine()
          Get define option.
 boolean getCompile()
           
 java.io.File getConfigFile()
           
 java.lang.String getDefine()
           
 java.lang.String[] getDefineAsArray()
          Returns the settings as a String[].
 java.lang.String getDisable()
           
 boolean getDisableValue()
          Get boolean value.
 java.lang.String getDump()
           
 java.lang.String getEnable()
           
 boolean getEnableValue()
          Get boolean value.
 boolean getGenerate()
           
 java.io.File getHomeFolder()
           
 java.io.File getOutputDirectory()
          Deprecated.  
 java.io.File getOutputFolder()
           
 boolean getQuiet()
           
 java.lang.String getTemplate()
           
 java.lang.String getTemplateList()
           
 java.lang.String[] getTemplateListAsArray()
          Returns the template list as a String[].
 java.io.File getTemplateListFile()
           
 java.lang.String getTemplateOptions()
           
 java.lang.String[] getTemplateOptionsAsArray()
          Returns the template options as a String[].
 java.lang.String getText()
           
 java.io.File getTrackFile()
           
 boolean getVerbose()
           
 java.io.File getWorkFolder()
           
 java.io.File getWorkingDirectory()
          Deprecated.  
 java.lang.String getWriterFormat()
           
 PropertySet makeCmdPropertySet()
           
 java.util.List makeTemplatePaths()
           
 void setAdditionalConfigFile(java.io.File pAdditionalConfigFile)
          Specifies an additional configuration file for Jostraca.
 void setBackup(boolean pBackup)
          True => make backups.
 void setBackupFolder(java.io.File pBackupFolder)
          Specifies the backup folder where the existing versions of generated files will be saved.
 void setClassPathPrefix(java.lang.String pClassPathPrefix)
          Set the prefix to the classpath for compiling and executing the CodeWriter.
 void setClassPathRef(org.apache.tools.ant.types.Reference pClassPathRef)
          Set the classpath for compiling and executing the CodeWriter.
 void setClassPathSuffix(java.lang.String pClassPathSuffix)
          Set the prefix to the classpath for compiling and executing the CodeWriter.
 void setCompile(boolean pCompile)
          True => compile templates
 void setConfigFile(java.io.File pConfigFile)
          Specifies the configuration file for Jostraca.
 void setDefine(java.lang.String pDefine)
          Define a configuration setting using Name=Value syntax Separate multiple defines with commas or spaces
 void setDisable(java.lang.String pDisable)
          True => do not perform generation
 void setDump(java.lang.String pDump)
          Dump template or settings to a file.
 void setEnable(java.lang.String pEnable)
          True => actually perform generation
 void setGenerate(boolean pGenerate)
          True => generate code
 void setHomeFolder(java.io.File pHomeFolder)
          Sets the home folder of the Jostraca installation.
 void setOutputDirectory(java.io.File pOutputFolder)
          Deprecated.  
 void setOutputFolder(java.io.File pOutputFolder)
          Specifies the output folder where the generated code will be saved.
 void setQuiet(boolean pQuiet)
          True => quiet mode - no console ouput
 void setTemplate(java.lang.String pTemplate)
          The template used to generate code.
 void setTemplateList(java.lang.String pTemplateList)
          Specifies a list of templates, comma or space separated
 void setTemplateListFile(java.io.File pTemplateListFile)
          A file containing a list of templates to use, one per line.
 void setTemplateOptions(java.lang.String pTemplateOptions)
          Specifies the template options, comma or space separated
 void setTrackFile(java.io.File pTrackFile)
          Set a tracking file to record detailed debugging information.
 void setVerbose(boolean pVerbose)
          True => verbose mode - more output to console
 void setWorkFolder(java.io.File pWorkFolder)
          Specifies the work folder where the CodeWriter will be saved.
 void setWorkingDirectory(java.io.File pWorkFolder)
          Deprecated.  
 void setWriterFormat(java.lang.String pWriterFormat)
          Specify WriterFormat.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JostracaTask

public JostracaTask()
Creates a new JostracaTask.

Method Detail

setTemplate

public void setTemplate(java.lang.String pTemplate)
The template used to generate code.

Parameters:
pTemplate - template file or reference
See Also:
getTemplate()

getTemplate

public java.lang.String getTemplate()
See Also:
setTemplate( String )

setTemplateList

public void setTemplateList(java.lang.String pTemplateList)
Specifies a list of templates, comma or space separated

Parameters:
pTemplateList - template list
See Also:
getTemplateList(), getTemplateListAsArray()

getTemplateList

public java.lang.String getTemplateList()
See Also:
setTemplateList( String )

getTemplateListAsArray

public java.lang.String[] getTemplateListAsArray()
Returns the template list as a String[]. The template options are seperated by a space (or comma), and each token is added to the array, so the order is preserved.

If there are no templates, a String[] with the length 0 is returned.


setTemplateListFile

public void setTemplateListFile(java.io.File pTemplateListFile)
A file containing a list of templates to use, one per line.

Parameters:
pTemplateListFile - file containing template list
See Also:
getTemplateListFile()

getTemplateListFile

public java.io.File getTemplateListFile()
See Also:
setTemplateListFile( File )

setTemplateOptions

public void setTemplateOptions(java.lang.String pTemplateOptions)
Specifies the template options, comma or space separated

Parameters:
pTemplateOptions - template options
See Also:
getTemplateOptions(), getTemplateOptionsAsArray()

getTemplateOptions

public java.lang.String getTemplateOptions()
See Also:
setTemplateOptions( String )

getTemplateOptionsAsArray

public java.lang.String[] getTemplateOptionsAsArray()
Returns the template options as a String[]. The template options are seperated by a space (or comma), and each token is added to the array, so the order is preserved.

If there are no template options, a String[] with the length 0 is returned.


setOutputFolder

public void setOutputFolder(java.io.File pOutputFolder)
Specifies the output folder where the generated code will be saved. It is passed to Jostraca using the option "-o outputFolder". If no output folder is specified, the option "-o" is not passed to Jostraca.

Parameters:
pOutputFolder - output folder for generated code
See Also:
getOutputFolder()

getOutputFolder

public java.io.File getOutputFolder()
See Also:
setOutputFolder( File )

getOutputDirectory

public java.io.File getOutputDirectory()
Deprecated.  

See Also:
setOutputFolder( File )

setOutputDirectory

public void setOutputDirectory(java.io.File pOutputFolder)
Deprecated.  

See Also:
getOutputFolder()

setWorkFolder

public void setWorkFolder(java.io.File pWorkFolder)
Specifies the work folder where the CodeWriter will be saved. It is passed to Jostraca using the option "-w workFolder". If no output folder is specified, the option "-w" is not passed to Jostraca.

Parameters:
pWorkFolder - output folder for CodeWriter
See Also:
getWorkFolder()

getWorkFolder

public java.io.File getWorkFolder()
See Also:
setWorkFolder( File )

getWorkingDirectory

public java.io.File getWorkingDirectory()
Deprecated.  

See Also:
getWorkFolder()

setWorkingDirectory

public void setWorkingDirectory(java.io.File pWorkFolder)
Deprecated.  

See Also:
setWorkFolder( File )

setBackupFolder

public void setBackupFolder(java.io.File pBackupFolder)
Specifies the backup folder where the existing versions of generated files will be saved. It is passed to Jostraca using the option "-b backupFolder". If no output folder is specified, the option "-b" is not passed to Jostraca.

Parameters:
pBackupFolder - backup folder for generated code
See Also:
getBackupFolder()

getBackupFolder

public java.io.File getBackupFolder()
See Also:
setBackupFolder( File )

setHomeFolder

public void setHomeFolder(java.io.File pHomeFolder)
Sets the home folder of the Jostraca installation. This option may be using instead of setConfigFile.

Parameters:
pHomeFolder - output folder where the generated code will be saved
See Also:
getHomeFolder()

getHomeFolder

public java.io.File getHomeFolder()
See Also:
setHomeFolder( File )

setConfigFile

public void setConfigFile(java.io.File pConfigFile)
Specifies the configuration file for Jostraca. It is passed to Jostraca using the option "-f configFile". If no config file is specified, the option "-f" is not passed to Jostraca.

An internal standard configuration is used if this attribute is not supplied.

Parameters:
pConfigFile - configuration file
See Also:
getConfigFile(), setHomeFolder( File )

getConfigFile

public java.io.File getConfigFile()
See Also:
setConfigFile( File )

setAdditionalConfigFile

public void setAdditionalConfigFile(java.io.File pAdditionalConfigFile)
Specifies an additional configuration file for Jostraca. It is passed to Jostraca using the option "-F configFile". If no config file is specified, the option "-F" is not passed to Jostraca.

Parameters:
pAdditionalConfigFile - configuration file
See Also:
getAdditionalConfigFile()

getAdditionalConfigFile

public java.io.File getAdditionalConfigFile()
See Also:
setAdditionalConfigFile( File )

setBackup

public void setBackup(boolean pBackup)
True => make backups.

Parameters:
pBackup -

getBackup

public boolean getBackup()
See Also:
setBackup( boolean )

setCompile

public void setCompile(boolean pCompile)
True => compile templates

Parameters:
pCompile -

getCompile

public boolean getCompile()
See Also:
setCompile( boolean )

setGenerate

public void setGenerate(boolean pGenerate)
True => generate code

Parameters:
pGenerate -

getGenerate

public boolean getGenerate()
See Also:
setGenerate( boolean )

setVerbose

public void setVerbose(boolean pVerbose)
True => verbose mode - more output to console

Parameters:
pVerbose -

getVerbose

public boolean getVerbose()
See Also:
setVerbose( boolean )

setQuiet

public void setQuiet(boolean pQuiet)
True => quiet mode - no console ouput

Parameters:
pQuiet -

getQuiet

public boolean getQuiet()
See Also:
setQuiet( boolean )

setEnable

public void setEnable(java.lang.String pEnable)
True => actually perform generation

Parameters:
pEnable - boolean expression
See Also:
setDisable( String )

getEnable

public java.lang.String getEnable()
See Also:
setEnable( String )

getEnableValue

public boolean getEnableValue()
Get boolean value.

See Also:
getEnable()

setDisable

public void setDisable(java.lang.String pDisable)
True => do not perform generation

Parameters:
pDisable - boolean expression
See Also:
setEnable( String )

getDisable

public java.lang.String getDisable()
See Also:
setDisable( String )

getDisableValue

public boolean getDisableValue()
Get boolean value.

See Also:
getEnable()

setWriterFormat

public void setWriterFormat(java.lang.String pWriterFormat)
Specify WriterFormat.

Parameters:
pWriterFormat - writer format

getWriterFormat

public java.lang.String getWriterFormat()
See Also:
setWriterFormat( String )

setDefine

public void setDefine(java.lang.String pDefine)
Define a configuration setting using Name=Value syntax Separate multiple defines with commas or spaces

Parameters:
pDefine - name=value pair(s)
See Also:
getDefine()

getDefine

public java.lang.String getDefine()
See Also:
setDefine( String )

getDefineAsArray

public java.lang.String[] getDefineAsArray()
Returns the settings as a String[].


setDump

public void setDump(java.lang.String pDump)
Dump template or settings to a file. Use the keywords settings,template.

Parameters:
pDump - dump keywords

getDump

public java.lang.String getDump()
See Also:
setDump( String )

setClassPathRef

public void setClassPathRef(org.apache.tools.ant.types.Reference pClassPathRef)
Set the classpath for compiling and executing the CodeWriter. Both : or ; function as element separator.

Parameters:
pClassPathRef - java classpath reference
See Also:
setClassPathPrefix( String ), setClassPathSuffix( String )

getClassPath

public java.lang.String getClassPath()
See Also:
setClassPathRef( Reference )

getClassPathDefine

public java.lang.String getClassPathDefine()
Get define option.

See Also:
getClassPath()

setClassPathPrefix

public void setClassPathPrefix(java.lang.String pClassPathPrefix)
Set the prefix to the classpath for compiling and executing the CodeWriter. Both : or ; function as element separator.

Parameters:
pClassPathPrefix - java classpath
See Also:
setClassPathPrefix( String ), setClassPathSuffix( String )

getClassPathPrefix

public java.lang.String getClassPathPrefix()
See Also:
setClassPathPrefix( String )

getClassPathPrefixDefine

public java.lang.String getClassPathPrefixDefine()
Get define option.

See Also:
getClassPathPrefix()

setClassPathSuffix

public void setClassPathSuffix(java.lang.String pClassPathSuffix)
Set the prefix to the classpath for compiling and executing the CodeWriter. Both : or ; function as element separator.

Parameters:
pClassPathSuffix - java classpath
See Also:
setClassPathSuffix( String ), setClassPathSuffix( String )

getClassPathSuffix

public java.lang.String getClassPathSuffix()
See Also:
setClassPathSuffix( String )

getClassPathSuffixDefine

public java.lang.String getClassPathSuffixDefine()
Get define option.

See Also:
getClassPathSuffix()

addText

public void addText(java.lang.String pText)

getText

public java.lang.String getText()

addTemplate

public void addTemplate(JostracaTask.Template pTemplate)

setTrackFile

public void setTrackFile(java.io.File pTrackFile)
Set a tracking file to record detailed debugging information.

Parameters:
pTrackFile - tracking file
See Also:
getTrackFile()

getTrackFile

public java.io.File getTrackFile()
See Also:
setTrackFile(File)

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Calls Jostraca.main( String[] ) with the specified arguments.

Throws:
org.apache.tools.ant.BuildException - no jostraca template was specified

makeTemplatePaths

public java.util.List makeTemplatePaths()

makeCmdPropertySet

public PropertySet makeCmdPropertySet()


Copyright © 2000-2002 Richard Rodger