Class SourceElementAttributeAction
- java.lang.Object
-
- org.apache.torque.generator.control.action.SourceElementAttributeAction
-
- All Implemented Interfaces:
MergepointAction
public class SourceElementAttributeAction extends Object implements MergepointAction
Applies an outlet to a given source element.
-
-
Constructor Summary
Constructors Constructor Description SourceElementAttributeAction(String element, String attributeName, Boolean acceptNotSet)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutletResultexecute(ControllerState controllerState)Returns the value of the configured attribute of the configured source element. ${...}StringtoString()
-
-
-
Constructor Detail
-
SourceElementAttributeAction
public SourceElementAttributeAction(String element, String attributeName, Boolean acceptNotSet)
Constructor.- Parameters:
element- the SourcePath to the element, not null.attributeName- The name of the attribute to evaluate, or null to access the attribute with name null.acceptNotSet- true if the attribute may not exist, false if it is an error that the attribute does not exist, null means true.
-
-
Method Detail
-
execute
public OutletResult execute(ControllerState controllerState) throws GeneratorException
Returns the value of the configured attribute of the configured source element. ${...} Tokens are replaced within the element path and the attribute name.- Specified by:
executein interfaceMergepointAction- Parameters:
controllerState- the current state of the controller.- Returns:
- The value of the attribute, or the empty String if acceptNotSet is true and the attribute is not set.
- Throws:
GeneratorException- if acceptNotSet is false and either no source element can be found or the attribute is not set.
-
-