Package org.apache.torque.ant.task

# Class TorqueGeneratorTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.torque.ant.task.TorqueGeneratorTask

All Implemented Interfaces:
  `Cloneable`

public class TorqueGeneratorTask extends org.apache.tools.ant.Task
Executes a unit of generation within the torque generator.

      ant goal generate

$Id: TorqueGeneratorTask.java 1917242 2024-04-21 13:30:19Z tv $

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.Task

  `target, taskName, taskType, wrapper`

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TorqueGeneratorTask()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Option`
  `createOption()`
  Creates a new option and adds it to the list of options.
  `void`
  `execute()`
  Runs the generation.
  `void`
  `setAddDebuggingInfoToOutput(boolean addDebuggingInfoToOutput)`
  Sets whether debugging information should be added to the output.
  `void`
  `setCombineFiles(Boolean combineFiles)`
  Sets whether all source files should be combined into one source tree.
  `void`
  `setConfigDir(File configDir)`
  `void`
  `setConfigPackage(String configPackage)`
  `void`
  `setDefaultOutputDir(File defaultOutputDir)`
  Sets the default output base directory for generated files.
  `void`
  `setDefaultOutputEncoding(Charset defaultOutputCharset)`
  Sets the encoding which should be used for the files which do not have an output encoding set in the templates.
  `void`
  `setJarFile(String jarFile)`
  The path to the jar file to use.
  `void`
  `setLoglevel(String loglevel)`
  Sets the Loglevel to use in the generation process.
  `void`
  `setOutputDirMap(Map<String,File> outputDirMap)`
  Sets the mapping from outputDirKey to output directories.
  `void`
  `setOverrideConfigDir(File overrideConfigDir)`
  Sets the config directory overriding the template settings.
  `void`
  `setPackaging(String packaging)`
  Sets the packaging.
  `void`
  `setProjectRootDir(File projectRootDir)`
  Sets the root directory of the project.
  `void`
  `setRunOnlyOnSourceChange(boolean runOnlyOnSourceChange)`
  Sets whether the generator should only run if one of the source files changes.
  `void`
  `setSourceDir(File sourceDir)`
  Sets the directory in which the source files are located.
  `void`
  `setSourceExcludes(Set<String> sourceExcludes)`
  Sets the pattern which files are excluded in the generation process.
  `void`
  `setSourceIncludes(Set<String> sourceIncludes)`
  Sets the pattern which files are included in the generation process.

  ### Methods inherited from class org.apache.tools.ant.Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TorqueGeneratorTask

    public TorqueGeneratorTask()

- ## Method Details

  - ### createOption

    public Option createOption()
    Creates a new option and adds it to the list of options.
    Returns:
      the newly created option.

  - ### execute

    public void execute() throws org.apache.tools.ant.BuildException
    Runs the generation.
    Overrides:
      `execute` in class `org.apache.tools.ant.Task`
    Throws:
      `org.apache.tools.ant.BuildException`

  - ### setPackaging

    public void setPackaging(String packaging)
    Sets the packaging.
    Parameters:
      `packaging` - the packaging, either "jar" or "directory"

  - ### setProjectRootDir

    public void setProjectRootDir(File projectRootDir)
    Sets the root directory of the project.
    Parameters:
      `projectRootDir` - the project root Directory.

  - ### setConfigDir

    public void setConfigDir(File configDir)

  - ### setConfigPackage

    public void setConfigPackage(String configPackage)

  - ### setDefaultOutputDir

    public void setDefaultOutputDir(File defaultOutputDir)
    Sets the default output base directory for generated files.
    Parameters:
      `defaultOutputDir` - the default output directory, or null to use the default.

  - ### setOutputDirMap

    public void setOutputDirMap(Map<String,File> outputDirMap)
    Sets the mapping from outputDirKey to output directories. The outputDirKeys are defined in the templates you use.
    Parameters:
      `outputDirMap` - the new outputDirMap.

  - ### setJarFile

    public void setJarFile(String jarFile)
    The path to the jar file to use.
    Parameters:
      `jarFile` - the jar file, or null.

  - ### setSourceDir

    public void setSourceDir(File sourceDir)
    Sets the directory in which the source files are located.
    Parameters:
      `sourceDir` - the directory in which the source files are located.

  - ### setSourceIncludes

    public void setSourceIncludes(Set<String> sourceIncludes)
    Sets the pattern which files are included in the generation process.
    Parameters:
      `sourceIncludes` - a list containing the include patterns, or null if no include pattern should be used.

  - ### setSourceExcludes

    public void setSourceExcludes(Set<String> sourceExcludes)
    Sets the pattern which files are excluded in the generation process.
    Parameters:
      `sourceExcludes` - a list containing the exclude patterns, or null if no exclude pattern should be used.

  - ### setOverrideConfigDir

    public void setOverrideConfigDir(File overrideConfigDir)
    Sets the config directory overriding the template settings. If set, the settings of this directory are used as "child" and the "normal" settings are used as "parent".
    Parameters:
      `overrideConfigDir` - the config directory overriding the template settings, or null if the template settings will not be overridden.

  - ### setLoglevel

    public void setLoglevel(String loglevel)
    Sets the Loglevel to use in the generation process.
    Parameters:
      `loglevel` - the loglevel, must be one of trace, debug, info, warn or error, or null if the loglevel defined in the templates should be used.

  - ### setAddDebuggingInfoToOutput

    public void setAddDebuggingInfoToOutput(boolean addDebuggingInfoToOutput)
    Sets whether debugging information should be added to the output.
    Parameters:
      `addDebuggingInfoToOutput` - true if debugging information should be added to the output, false otherwise.

  - ### setRunOnlyOnSourceChange

    public void setRunOnlyOnSourceChange(boolean runOnlyOnSourceChange)
    Sets whether the generator should only run if one of the source files changes. The default value is false.
    Parameters:
      `runOnlyOnSourceChange` - true if the generator should only run if one of the source files changes, false if it should always run irrespective of changes in the source files.

  - ### setDefaultOutputEncoding

    public void setDefaultOutputEncoding(Charset defaultOutputCharset)
    Sets the encoding which should be used for the files which do not have an output encoding set in the templates.
    Parameters:
      `defaultOutputCharset` - the default output encoding, or null to use the generator default (the platform default encoding).

  - ### setCombineFiles

    public void setCombineFiles(Boolean combineFiles)
    Sets whether all source files should be combined into one source tree. If false, each source file will be read in its own source tree and start a new generation run. If true, a single source tree with the following structure will be built from all source files: <source> <file path="path/to/file1"> <rootOfFile1> ... </rootOfFile1> </file> <file path="path/to/file2"> <rootOfFile2> ... </rootOfFile2> </file> ... </source> If not set, the settings from the templates will be used.
    Parameters:
      `combineFiles` - whether all sources should be combined.