public class TorqueGenGroovy extends Object
Constructor and Description |
---|
TorqueGenGroovy(GroovyOutlet outlet,
ControllerState controllerState)
Constructs a generator interface within the given controllerState.
|
Modifier and Type | Method and Description |
---|---|
boolean |
booleanOption(String key)
Returns the option with the given key as boolean value.
|
ControllerState |
getControllerState()
Returns the current controller state.
|
static int |
getCounter()
Returns a counter value which is increased each time this function is
accessed.
|
Object |
getModel()
Returns the current model.
|
Object |
getOption(String key)
Returns the option with the given key.
|
File |
getSourceFile()
Returns the currently processed source file.
|
Object |
getVariable(String key)
Returns the variable with the given key.
|
int |
intOption(String key)
Returns the option with the given key as int value.
|
String |
mergepoint(String mergepointName)
Processes the mergepoint with the given name.
|
Date |
now()
Returns the current date.
|
Object |
option(String key)
Returns the option with the given key.
|
static void |
resetCounter()
Resets the counter accessible though
getCounter() back to 1. |
void |
setVariable(String key,
Object value)
Sets a variable.
|
void |
setVariable(String key,
Object value,
String scope)
Sets a variable.
|
public TorqueGenGroovy(GroovyOutlet outlet, ControllerState controllerState)
outlet
- the outlet in which this generator interface will be used,
not null.controllerState
- the controller context.NullPointerException
- if outlet or controllerState are null.public String mergepoint(String mergepointName) throws GeneratorException
mergepointName
- the name of the mergepoint.GeneratorException
- if the mergepoint could not be processed
completely.public ControllerState getControllerState()
public Object getModel()
getControllerState().getModel()
public Object option(String key)
key
- the key for the option to retrieve.public Object getOption(String key)
key
- the key for the option to retrieve.public boolean booleanOption(String key)
key
- the key for the option to retrieve.public int intOption(String key)
key
- the key for the option to retrieve.public Object getVariable(String key)
key
- the key for the variable to retrieve.public void setVariable(String key, Object value)
key
- the name of the variable, not nullvalue
- the value of the variable, may be null.NullPointerException
- if key or scope is null.IllegalArgumentException
- if the key is no valid QualifiedName.public void setVariable(String key, Object value, String scope)
key
- the name of the variable, not null.value
- the value of the variable, may be null.scope
- the scope of the variable, not null.NullPointerException
- if key or scope is null.IllegalArgumentException
- if the key is no valid QualifiedName.public File getSourceFile()
public Date now()
public static int getCounter()
resetCounter
is not called, the returned value is unique
over the generation process.public static void resetCounter()
getCounter()
back to 1.Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.