Class Controller
java.lang.Object
org.apache.torque.generator.control.Controller
Reads the configuration and generates the output accordingly.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidInitializes the Logging.protected voidcreateOutputFilename(Output output, ControllerState controllerState) Creates the output file name and sets it in the output.protected voidprocessGenerationUnit(ControllerState controllerState, UnitConfiguration unitConfiguration) Processes a unit of generation.voidrun(List<UnitDescriptor> unitDescriptors) Executes the controller action.transformSource(Object sourceRoot, List<SourceTransformerDefinition> transformerDefinitions, ControllerState controllerState) Applies all transformer definitions to the current source.
-
Field Details
-
LAST_SOURCE_CHANGE_CACHE_FILE
The file in the work directory where last source changes are stored.- See Also:
-
NO_CHECKSUM_CONTENT
The content of checksum files if no checksum can be computed.- See Also:
-
-
Constructor Details
-
Controller
public Controller()
-
-
Method Details
-
run
Executes the controller action.- Parameters:
unitDescriptors- the units of generation to execute.- Throws:
ControllerException- if a ControllerException occurs during processing.ConfigurationException- if a ConfigurationException occurs during processing.GeneratorException- if a OutletException occurs during processing.
-
checkLogging
protected void checkLogging()Initializes the Logging. -
processGenerationUnit
protected void processGenerationUnit(ControllerState controllerState, UnitConfiguration unitConfiguration) throws GeneratorException Processes a unit of generation.- Parameters:
controllerState- the controller state, not null.unitConfiguration- the configuration of the generation unit to process, not null.- Throws:
GeneratorException- if a generation error occurs.
-
createOutputFilename
protected void createOutputFilename(Output output, ControllerState controllerState) throws GeneratorException Creates the output file name and sets it in the output. The filename is calculated either by the filenameConfigurator inoutputor is given explicitly (in the latter case nothing needs to be done).- Parameters:
output- The output to process, not null.controllerState- the controller state, not null.- Throws:
ConfigurationException- if an incorrect configuration is encountered, e.g. if neither filename nor filenameOutlet is set in output.GeneratorException- if an error occurs during generation of the output filename.
-
transformSource
public Object transformSource(Object sourceRoot, List<SourceTransformerDefinition> transformerDefinitions, ControllerState controllerState) throws SourceTransformerException, SourceException Applies all transformer definitions to the current source.- Parameters:
sourceRoot- the root element of the source to transform, not null.transformerDefinitions- the transformer definitions to apply, not null.controllerState- the current controller state, not null.- Returns:
- the transformed root element, not null.
- Throws:
SourceTransformerException- if error in transformSourceException- if source not found
-