Klasse OutletImpl
java.lang.Object
org.apache.torque.generator.outlet.OutletImpl
- Alle implementierten Schnittstellen:
Outlet
- Bekannte direkte Unterklassen:
CopyOutlet
,JavadocOutlet
,JavaFilenameOutlet
,ModifySourcenameOutlet
,OutletWithoutMergepoints
,TemplateOutletImpl
Implementation of the features in the
Outlet
interface
which do not depend on type of Outlet.-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungOutletImpl
(QualifiedName name) Constructs a OutletImpl with the given name. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
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.Returns the fully qualified name of the input root class.Returns the name of the input root element.getMergepointMapping
(String name) Returns the mergepoint mapping for the given mergepoint name.Returns the map of all mergepoint mappings, keyed by their name.getName()
Returns the name of the outlet.getVariable
(String key, ControllerState controllerState) Returns the variable with the given key.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.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.toString()
-
Konstruktordetails
-
OutletImpl
Constructs a OutletImpl with the given name.- Parameter:
name
- the name of this outlet, not null.- Löst aus:
NullPointerException
- if name is null.
-
-
Methodendetails
-
getName
Beschreibung aus Schnittstelle kopiert:Outlet
Returns the name of the outlet. The namespace part of the name defines the default context of the outlet. -
getInputElementName
Beschreibung aus Schnittstelle kopiert:Outlet
Returns the name of the input root element. If not null, the outlet checks if the name of the input root element corresponds to the set element name and throws an exception if the names do not match.- Angegeben von:
getInputElementName
in SchnittstelleOutlet
- Gibt zurück:
- inputName the name of the root element of the source, or if any input name is accepted.
-
setInputElementName
Beschreibung aus Schnittstelle kopiert:Outlet
Sets the name of the input root element. If set, the outlet checks if the name of the input root element corresponds to the set element name and throws an exception if the names do not match.- Angegeben von:
setInputElementName
in SchnittstelleOutlet
- Parameter:
inputElementName
- the name of the root element of the source, or null to accept any input name.
-
getInputClass
Beschreibung aus Schnittstelle kopiert:Outlet
Returns the fully qualified name of the input root class. If not null, the outlet checks if the class name of the input root corresponds to the set class name and throws an exception if the names do not match.- Angegeben von:
getInputClass
in SchnittstelleOutlet
- Gibt zurück:
- inputName the name of the root element of the source, or if any input name is accepted.
-
setInputClass
Beschreibung aus Schnittstelle kopiert:Outlet
Sets the fully qualified name of the input model root class. If set, the outlet checks if the class name of the input model root corresponds to the set class name and throws an exception if the names do not match.- Angegeben von:
setInputClass
in SchnittstelleOutlet
- Parameter:
inputClass
- the name of the root element of the source, or null to accept any input name.
-
addMergepointMapping
Adds an mergepoint mapping to the outlet. No mergepoint mappings must exist with the given name.- Angegeben von:
addMergepointMapping
in SchnittstelleOutlet
- Parameter:
mergepointMapping
- the mergepointMapping to add, not null.- Löst aus:
NullPointerException
- if mergepointMapping is null.ConfigurationException
- if an mergepointMapping for the given name already exists.
-
setMergepointMapping
Sets an mergepoint mapping in the outlet. If a mergepoint mapping with the given name already exists, it is replaced.- Angegeben von:
setMergepointMapping
in SchnittstelleOutlet
- Parameter:
mergepointMapping
- the mergepointMapping to add, not null.- Gibt zurück:
- the replaced mergepoint mapping, not null.
- Löst aus:
NullPointerException
- if mergepointMapping is null.
-
getMergepointMapping
Returns the mergepoint mapping for the given mergepoint name.- Angegeben von:
getMergepointMapping
in SchnittstelleOutlet
- Parameter:
name
- the name of the mergepoint mapping.- Gibt zurück:
- the mergepoint mapping for the given name, or null if no mergepoint mapping exists for this name.
-
getMergepointMappings
Beschreibung aus Schnittstelle kopiert:Outlet
Returns the map of all mergepoint mappings, keyed by their name.- Angegeben von:
getMergepointMappings
in SchnittstelleOutlet
- Gibt zurück:
- the map of mergepoint mappings, not null.
-
beforeExecute
Beschreibung aus Schnittstelle kopiert:Outlet
Adjusts the state of the Controller before generation.- Angegeben von:
beforeExecute
in SchnittstelleOutlet
- Parameter:
controllerState
- the current controller state, not null.- Löst aus:
GeneratorException
- if adjusting the controller state fails.
-
afterExecute
Beschreibung aus Schnittstelle kopiert:Outlet
Adjusts the state of the Controller after generation.- Angegeben von:
afterExecute
in SchnittstelleOutlet
- Parameter:
controllerState
- the current controller state, not null.
-
execute
Beschreibung aus Schnittstelle kopiert:Outlet
Generates the output for this template into the Generated object.- Angegeben von:
execute
in SchnittstelleOutlet
- Parameter:
controllerState
- the current controller state, not null.- Gibt zurück:
- the output of the Outlet.
- Löst aus:
GeneratorException
- if generation fails.
-
toString
-
setVariable
Sets a variable. The key can be given with or without namespace; in the latter case, the variable is set in the namespace of this outlet. The scope of the variable is this outlet and its children.- Parameter:
key
- the name of the variable, not nullvalue
- the value of the variable, may be null.controllerState
- the context of the controller, not null.- Löst aus:
NullPointerException
- if key, scope or controllerState is null.IllegalArgumentException
- if the key is no valid QualifiedName.
-
setVariable
public void setVariable(String key, Object value, Variable.Scope scope, ControllerState controllerState) Sets a variable. The key can be given with or without namespace; in the latter case, the variable is set in the namespace of this outlet.- Parameter:
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.- Löst aus:
NullPointerException
- if key or scope is null.IllegalArgumentException
- if the key is no valid QualifiedName.
-
getVariable
Returns the variable with the given key. The key can either be a name prefixed with a namespace, or a name without namespace, in which case the namespace of the outlet is used. In the case that the variable is not set in this namespace, the parent namespaces are searched recursively. If the variable is not set in any of the parent namespaces, null is returned.- Parameter:
key
- the key for the variable to retrieve.controllerState
- the context of the controller, not null.- Gibt zurück:
- the variable for the given key, or null if the variable is not set or explicitly set to null.
-
mergepoint
public String mergepoint(String mergepointName, ControllerState controllerState) throws GeneratorException Processes the mergepoint with the given name.- Parameter:
mergepointName
- the name of the mergepoint.controllerState
- the context of the controller, not null.- Gibt zurück:
- the output generated by the mergepoint.
- Löst aus:
GeneratorException
- if the mergepoint could not be processed completely.
-