public class ControllerState extends Object
Constructor and Description |
---|
ControllerState() |
Modifier and Type | Method and Description |
---|---|
boolean |
getBooleanOption(OptionName optionName)
Convenience method to return the value of an option as boolean.
|
boolean |
getBooleanOption(String name)
Convenience method to return the value of an option as boolean.
|
Checksums |
getLastGeneratedSourceChecksums()
Returns the checksums of the source files for the last generation run.
|
Object |
getModel()
Returns the current model object within the source.
|
Object |
getModelRoot()
Returns the root object of the current source.
|
Object |
getOption(OptionName optionName)
Calculates the value of an option in the current outlet's context.
|
Object |
getOption(String name)
Calculates the value of an option in the current outlet's context.
|
Outlet |
getOutlet()
Returns the topmost outlet in the stack of outlets.
|
Namespace |
getOutletNamespace()
Returns the namespace of the outlet which is currently active.
|
Output |
getOutput()
Returns the output declaration which is currently processed.
|
File |
getOutputFile()
Returns the currently generated file.
|
String |
getPathToModel()
Returns the path from the model root to the current model.
|
QualifiedName |
getQualifiedName(String name)
Converts a name to a QualifiedName, using the outlet namespace as
default namespace is none is given.
|
OutletReference |
getRootOutletReference()
Returns the reference to the current outlet.
|
File |
getSourceFile()
Returns the currently used source file.
|
SourceProvider |
getSourceProvider()
Returns the source provider which is currently in use.
|
String |
getStringOption(OptionName optionName)
Convenience method to return the value of an option as String.
|
String |
getStringOption(String name)
Convenience method to return the value of an option as String.
|
Checksums |
getThisGenerationSourceChecksums()
Returns the checksums of the source files for this generation run.
|
UnitConfiguration |
getUnitConfiguration()
Returns the configuration of the currently processed generation unit.
|
VariableStore |
getVariableStore()
Returns the VariableStore where generation variables can be set.
|
Options |
getVisibleOptions()
Returns all options which are visible from the current outlet's
namespace.
|
Outlet |
popOutlet()
Pops the topmost outlets from the stack of outlets.
|
void |
pushOutlet(Outlet outlet)
Pushes a outlet onto the stack of outlets.
|
void |
setModel(Object model,
String newPathToModel)
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.
|
String |
toString() |
public SourceProvider getSourceProvider()
public void setSourceProvider(SourceProvider sourceProvider)
sourceProvider
- the current source provider.public Output getOutput()
public Outlet getOutlet()
public void pushOutlet(Outlet outlet)
outlet
- the outlet to be added to the stack of outlets,
not null.public Outlet popOutlet()
IndexOutOfBoundsException
- if the stack is empty.public Object getModel()
public void setModel(Object model, String newPathToModel)
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.public String getPathToModel()
public void setPathToModel(String pathToModel)
pathToModel
- the path from the model root to the current model,
not null.public Object getModelRoot()
public void setModelRoot(Object modelRoot)
modelRoot
- the the root object of the current source,
or null to remove the current root object.public OutletReference getRootOutletReference()
public Namespace getOutletNamespace()
public Object getOption(String name)
name
is the namespace of the currently used outlet.name
- the name of the option, can contain a namespace.public Object getOption(OptionName optionName)
name
is the namespace of the currently used outlet.optionName
- the object containing the name of the option,
which can contain a namespace, not null.NullPointerException
- if optionName is null.public boolean getBooleanOption(String name)
Uses Boolean.paseBoolean() for String -> Boolean conversion.
name
- the name of the option, can contain a namespace.public boolean getBooleanOption(OptionName optionName)
Uses Boolean.paseBoolean() for String -> Boolean conversion.
optionName
- the object containing the name of the option,
which can contain a namespace.NullPointerException
- if optionName is null.public String getStringOption(String name)
name
- the name of the option, can contain a namespace.public String getStringOption(OptionName optionName)
optionName
- the object containing the name of the option,
which can contain a namespace.NullPointerException
- if optionName is null.public Options getVisibleOptions()
public VariableStore getVariableStore()
public QualifiedName getQualifiedName(String name)
name
- the name to convert to a qualifiedName, not null.NullPointerException
- if name is nullIllegalArgumentException
- if name is no valid qualifiedName.public File getOutputFile()
public File getSourceFile()
public void setSourceFile(File sourceFile)
sourceFile
- the current source file, or null to remove the
source file.public UnitConfiguration getUnitConfiguration()
public void setUnitConfiguration(UnitConfiguration unitConfiguration)
unitConfiguration
- the configuration of the currently processed
generation unit.public Checksums getLastGeneratedSourceChecksums()
public Checksums getThisGenerationSourceChecksums()
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.