Klasse ControllerState

java.lang.Object
org.apache.torque.generator.control.ControllerState

public class ControllerState extends Object
The state of the controller. Contains all stuff the controller needs to track. Initialization steps in Controller.run(List):
  1. First unitConfiguration UnitConfiguration is set in Controller.processGenerationUnit(ControllerState, UnitConfiguration)
  2. Second output Output and sourceProvider SourceProvider is set and reset in private method processOutput of Controller.
  3. Third sourceFile, modelRoot and model is set in private method processSourceInOutput of Controller.
  4. Fourth outputFile, outletNamespace, rootOutletReference is set in private method processModel of Controller .
  • Konstruktordetails

    • ControllerState

      public ControllerState()
  • Methodendetails

    • getSourceProvider

      public SourceProvider getSourceProvider()
      Returns the source provider which is currently in use.
      Gibt zurück:
      the current source provider.
    • setSourceProvider

      public void setSourceProvider(SourceProvider sourceProvider)
      Sets the source provider which is currently in use.
      Parameter:
      sourceProvider - the current source provider.
    • getOutput

      public Output 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

      public Outlet 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

      public void pushOutlet(Outlet outlet)
      Pushes a outlet onto the stack of outlets.
      Parameter:
      outlet - the outlet to be added to the stack of outlets, not null.
    • popOutlet

      public Outlet 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

      public Object getModel()
      Returns the current model object within the source. Does not return null during generation.
      Gibt zurück:
      the current model object.
    • setModel

      public void setModel(Object model, String newPathToModel)
      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

      public String 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

      public void setPathToModel(String pathToModel)
      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

      public Object 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

      public void setModelRoot(Object modelRoot)
      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

      public OutletReference 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

      public Namespace 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

      public Object getOption(String name)
      Calculates the value of an option in the current outlet's context. The default namespace which is used when no namespace is given in name 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

      public Object getOption(OptionName optionName)
      Calculates the value of an option in the current outlet's context. The default namespace which is used when no namespace is given in name 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

      public boolean getBooleanOption(String name)
      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

      public boolean getBooleanOption(OptionName optionName)
      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

      public String getStringOption(String name)
      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

      public String getStringOption(OptionName optionName)
      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

      public Options getVisibleOptions()
      Returns all options which are visible from the current outlet's namespace.
      Gibt zurück:
      all visible options, not null.
    • getVariableStore

      public VariableStore getVariableStore()
      Returns the VariableStore where generation variables can be set.
      Gibt zurück:
      the variableStore, never null.
    • getQualifiedName

      public QualifiedName getQualifiedName(String name)
      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 null
      IllegalArgumentException - if name is no valid qualifiedName.
    • getOutputFile

      public File 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

      public File 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

      public void setSourceFile(File sourceFile)
      Sets the currently used source file.
      Parameter:
      sourceFile - the current source file, or null to remove the source file.
    • getUnitConfiguration

      public UnitConfiguration getUnitConfiguration()
      Returns the configuration of the currently processed generation unit.
      Gibt zurück:
      the configuration of the currently processed generation unit.
    • setUnitConfiguration

      public void setUnitConfiguration(UnitConfiguration unitConfiguration)
      Sets the configuration of the currently processed generation unit.
      Parameter:
      unitConfiguration - the configuration of the currently processed generation unit.
    • getLastGeneratedSourceChecksums

      public Checksums getLastGeneratedSourceChecksums()
      Returns the checksums of the source files for the last generation run.
      Gibt zurück:
      the checksums, not null.
    • getThisGenerationSourceChecksums

      public Checksums getThisGenerationSourceChecksums()
      Returns the checksums of the source files for this generation run.
      Gibt zurück:
      the checksums, not null.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object