org.apache.torque.generator.control.action
Class SourceElementAttributeAction

java.lang.Object
  extended by 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
SourceElementAttributeAction(String element, String attributeName, Boolean acceptNotSet)
          Constructor.
 
Method Summary
 OutletResult execute(ControllerState controllerState)
          Returns the value of the configured attribute of the configured source element.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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:
execute in interface MergepointAction
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.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.