Klasse ControllerState
java.lang.Object
org.apache.torque.generator.control.ControllerState
The state of the controller. Contains all stuff the controller needs to
track.
Initialization steps in
Controller.run(List)
:
- First
unitConfiguration
UnitConfiguration
is set inController.processGenerationUnit(ControllerState, UnitConfiguration)
- Second
output
Output
andsourceProvider
SourceProvider
is set and reset in private method processOutput ofController
. - Third
sourceFile
,modelRoot
andmodel
is set in private method processSourceInOutput ofController
. - Fourth
outputFile
,outletNamespace
,rootOutletReference
is set in private method processModel ofController
.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
getBooleanOption
(String name) Convenience method to return the value of an option as boolean.boolean
getBooleanOption
(OptionName optionName) Convenience method to return the value of an option as boolean.Returns the checksums of the source files for the last generation run.getModel()
Returns the current model object within the source.Returns the root object of the current source.Calculates the value of an option in the current outlet's context.getOption
(OptionName optionName) Calculates the value of an option in the current outlet's context.Returns the topmost outlet in the stack of outlets.Returns the namespace of the outlet which is currently active.Returns the output declaration which is currently processed.Returns the currently generated file.Returns the path from the model root to the current model.getQualifiedName
(String name) Converts a name to a QualifiedName, using the outlet namespace as default namespace is none is given.Returns the reference to the current outlet.Returns the currently used source file.Returns the source provider which is currently in use.getStringOption
(String name) Convenience method to return the value of an option as String.getStringOption
(OptionName optionName) Convenience method to return the value of an option as String.Returns the checksums of the source files for this generation run.Returns the configuration of the currently processed generation unit.Returns the VariableStore where generation variables can be set.Returns all options which are visible from the current outlet's namespace.Pops the topmost outlets from the stack of outlets.void
pushOutlet
(Outlet outlet) Pushes a outlet onto the stack of outlets.void
Sets the current source model object.void
setModelRoot
(Object modelRoot) Sets the root object of the current source.void
setPathToModel
(String pathToModel) Sets the path from the model root to the current model.void
setSourceFile
(File sourceFile) Sets the currently used source file.void
setSourceProvider
(SourceProvider sourceProvider) Sets the source provider which is currently in use.void
setUnitConfiguration
(UnitConfiguration unitConfiguration) Sets the configuration of the currently processed generation unit.toString()
-
Konstruktordetails
-
ControllerState
public ControllerState()
-
-
Methodendetails
-
getSourceProvider
Returns the source provider which is currently in use.- Gibt zurück:
- the current source provider.
-
setSourceProvider
Sets the source provider which is currently in use.- Parameter:
sourceProvider
- the current source provider.
-
getOutput
Returns the output declaration which is currently processed.- Gibt zurück:
- the output declaration which is currently processed, may be null only if no output is processed at the moment.
-
getOutlet
Returns the topmost outlet in the stack of outlets.- Gibt zurück:
- the topmost outlet in the stack of outlets, or null if the stack is empty.
-
pushOutlet
Pushes a outlet onto the stack of outlets.- Parameter:
outlet
- the outlet to be added to the stack of outlets, not null.
-
popOutlet
Pops the topmost outlets from the stack of outlets.- Gibt zurück:
- the removed outlet, not null.
- Löst aus:
IndexOutOfBoundsException
- if the stack is empty.
-
getModel
Returns the current model object within the source. Does not return null during generation.- Gibt zurück:
- the current model object.
-
setModel
Sets the current source model object.- Parameter:
model
- the new current source model object, or null to remove the current source model object.newPathToModel
- the path from root to the new model, or null to leave the path unchanged.
-
getPathToModel
Returns the path from the model root to the current model.- Gibt zurück:
- the path from the model root to the current model, not null.
-
setPathToModel
Sets the path from the model root to the current model.- Parameter:
pathToModel
- the path from the model root to the current model, not null.
-
getModelRoot
Returns the root object of the current source.- Gibt zurück:
- The the root object of the current source; may be null only if no source is currently processed.
-
setModelRoot
Sets the root object of the current source.- Parameter:
modelRoot
- the the root object of the current source, or null to remove the current root object.
-
getRootOutletReference
Returns the reference to the current outlet.- Gibt zurück:
- the reference to the current outlet, or null if no outlet is currently active.
-
getOutletNamespace
Returns the namespace of the outlet which is currently active.- Gibt zurück:
- the name space of the active outlet. May be null only if no generation is in progress.
-
getOption
Calculates the value of an option in the current outlet's context. The default namespace which is used when no namespace is given inname
is the namespace of the currently used outlet.- Parameter:
name
- the name of the option, can contain a namespace.- Gibt zurück:
- The value of the option, or null if no option with that name is visible from the given namespace.
-
getOption
Calculates the value of an option in the current outlet's context. The default namespace which is used when no namespace is given inname
is the namespace of the currently used outlet.- Parameter:
optionName
- the object containing the name of the option, which can contain a namespace, not null.- Gibt zurück:
- The value of the option, or null if no option with that name is visible from the given namespace.
- Löst aus:
NullPointerException
- if optionName is null.
-
getBooleanOption
Convenience method to return the value of an option as boolean. The option is evaluated in the current outlet's context, see getOption(String).Uses Boolean.paseBoolean() for String -> Boolean conversion.
- Parameter:
name
- the name of the option, can contain a namespace.- Gibt zurück:
- The value of the option as boolean, or false if no option with that name is visible from the given namespace,
-
getBooleanOption
Convenience method to return the value of an option as boolean. The option is evaluated in the current outlet's context, see getOption(String).Uses Boolean.paseBoolean() for String -> Boolean conversion.
- Parameter:
optionName
- the object containing the name of the option, which can contain a namespace.- Gibt zurück:
- The value of the option as boolean, or false if no option with that name is visible from the given namespace.
- Löst aus:
NullPointerException
- if optionName is null.
-
getStringOption
Convenience method to return the value of an option as String. The option is evaluated in the current outlet's context, see getOption(String).- Parameter:
name
- the name of the option, can contain a namespace.- Gibt zurück:
- The value of the option as boolean, or false if no option with that name is visible from the given namespace,
-
getStringOption
Convenience method to return the value of an option as String. The option is evaluated in the current outlet's context, see getOption(String).- Parameter:
optionName
- the object containing the name of the option, which can contain a namespace.- Gibt zurück:
- The value of the option as String, or null if no option with that name is visible from the given namespace,
- Löst aus:
NullPointerException
- if optionName is null.
-
getVisibleOptions
Returns all options which are visible from the current outlet's namespace.- Gibt zurück:
- all visible options, not null.
-
getVariableStore
Returns the VariableStore where generation variables can be set.- Gibt zurück:
- the variableStore, never null.
-
getQualifiedName
Converts a name to a QualifiedName, using the outlet namespace as default namespace is none is given.- Parameter:
name
- the name to convert to a qualifiedName, not null.- Gibt zurück:
- the corresponding qualifiedName.
- Löst aus:
NullPointerException
- if name is nullIllegalArgumentException
- if name is no valid qualifiedName.
-
getOutputFile
Returns the currently generated file.- Gibt zurück:
- the current output file. May only be null if no output file is currently generated (e.g. if the file name is currently generated).
-
getSourceFile
Returns the currently used source file.- Gibt zurück:
- the current source file. May be null if no source file is currently used (e.g. if the source is created by other means than reading a file).
-
setSourceFile
Sets the currently used source file.- Parameter:
sourceFile
- the current source file, or null to remove the source file.
-
getUnitConfiguration
Returns the configuration of the currently processed generation unit.- Gibt zurück:
- the configuration of the currently processed generation unit.
-
setUnitConfiguration
Sets the configuration of the currently processed generation unit.- Parameter:
unitConfiguration
- the configuration of the currently processed generation unit.
-
getLastGeneratedSourceChecksums
Returns the checksums of the source files for the last generation run.- Gibt zurück:
- the checksums, not null.
-
getThisGenerationSourceChecksums
Returns the checksums of the source files for this generation run.- Gibt zurück:
- the checksums, not null.
-
toString
-