public abstract class OutletImpl extends Object implements Outlet
Outlet
interface
which do not depend on type of Outlet.Constructor and Description |
---|
OutletImpl(QualifiedName name)
Constructs a OutletImpl with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addMergepointMapping(MergepointMapping mergepointMapping)
Adds an mergepoint mapping to the outlet.
|
void |
afterExecute(ControllerState controllerState)
Adjusts the state of the Controller after generation.
|
void |
beforeExecute(ControllerState controllerState)
Adjusts the state of the Controller before generation.
|
abstract OutletResult |
execute(ControllerState controllerState)
Generates the output for this template into the Generated object.
|
String |
getInputClass()
Returns the fully qualified name of the input root class.
|
String |
getInputElementName()
Returns the name of the input root element.
|
MergepointMapping |
getMergepointMapping(String name)
Returns the mergepoint mapping for the given mergepoint name.
|
Map<String,MergepointMapping> |
getMergepointMappings()
Returns the map of all mergepoint mappings, keyed by their name.
|
QualifiedName |
getName()
Returns the name of the outlet.
|
Object |
getVariable(String key,
ControllerState controllerState)
Returns the variable with the given key.
|
String |
mergepoint(String mergepointName,
ControllerState controllerState)
Processes the mergepoint with the given name.
|
void |
setInputClass(String inputClass)
Sets the fully qualified name of the input model root class.
|
void |
setInputElementName(String inputElementName)
Sets the name of the input root element.
|
MergepointMapping |
setMergepointMapping(MergepointMapping mergepointMapping)
Sets an mergepoint mapping in the outlet.
|
void |
setVariable(String key,
Object value,
ControllerState controllerState)
Sets a variable.
|
void |
setVariable(String key,
Object value,
Variable.Scope scope,
ControllerState controllerState)
Sets a variable.
|
String |
toString() |
public OutletImpl(QualifiedName name)
name
- the name of this outlet, not null.NullPointerException
- if name is null.public QualifiedName getName()
Outlet
public String getInputElementName()
Outlet
getInputElementName
in interface Outlet
public void setInputElementName(String inputElementName)
Outlet
setInputElementName
in interface Outlet
inputElementName
- the name of the root element of the source,
or null to accept any input name.public String getInputClass()
Outlet
getInputClass
in interface Outlet
public void setInputClass(String inputClass)
Outlet
setInputClass
in interface Outlet
inputClass
- the name of the root element of the source,
or null to accept any input name.public void addMergepointMapping(MergepointMapping mergepointMapping) throws ConfigurationException
addMergepointMapping
in interface Outlet
mergepointMapping
- the mergepointMapping to add, not null.NullPointerException
- if mergepointMapping is null.ConfigurationException
- if an mergepointMapping
for the given name already exists.public MergepointMapping setMergepointMapping(MergepointMapping mergepointMapping)
setMergepointMapping
in interface Outlet
mergepointMapping
- the mergepointMapping to add, not null.NullPointerException
- if mergepointMapping is null.public MergepointMapping getMergepointMapping(String name)
getMergepointMapping
in interface Outlet
name
- the name of the mergepoint mapping.public Map<String,MergepointMapping> getMergepointMappings()
Outlet
getMergepointMappings
in interface Outlet
public void beforeExecute(ControllerState controllerState) throws GeneratorException
Outlet
beforeExecute
in interface Outlet
controllerState
- the current controller state, not null.GeneratorException
- if adjusting the controller state fails.public void afterExecute(ControllerState controllerState)
Outlet
afterExecute
in interface Outlet
controllerState
- the current controller state, not null.public abstract OutletResult execute(ControllerState controllerState) throws GeneratorException
Outlet
execute
in interface Outlet
controllerState
- the current controller state, not null.GeneratorException
- if generation fails.public void setVariable(String key, Object value, ControllerState controllerState)
key
- the name of the variable, not nullvalue
- the value of the variable, may be null.controllerState
- the context of the controller, not null.NullPointerException
- if key, scope or controllerState is null.IllegalArgumentException
- if the key is no valid QualifiedName.public void setVariable(String key, Object value, Variable.Scope scope, ControllerState controllerState)
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.controllerState
- the context of the controller, not null.NullPointerException
- if key or scope is null.IllegalArgumentException
- if the key is no valid QualifiedName.public Object getVariable(String key, ControllerState controllerState)
key
- the key for the variable to retrieve.controllerState
- the context of the controller, not null.public String mergepoint(String mergepointName, ControllerState controllerState) throws GeneratorException
mergepointName
- the name of the mergepoint.controllerState
- the context of the controller, not null.GeneratorException
- if the mergepoint could not be processed
completely.Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.