net.sf.doolin.oxml.action
Class PropertyOXMLAction

java.lang.Object
  extended by net.sf.doolin.oxml.action.AbstractOXMLAction
      extended by net.sf.doolin.oxml.action.PropertyOXMLAction
All Implemented Interfaces:
OXMLAction

public class PropertyOXMLAction
extends AbstractOXMLAction

property action.

Author:
Damien Coraboeuf

Constructor Summary
PropertyOXMLAction()
           
 
Method Summary
 void parse(Element e)
          Parses the action from an XML configuration.
 void process(OXMLContext context)
          Processes the action against a context
protected  void setProperty(Object instance, Object propertyValue)
          Sets the property on a instance, using the parameters of this action.
protected  Object toEnum(Object instance, Object propertyValue)
          Converts, if possible, the property value to a corresponding enumeration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyOXMLAction

public PropertyOXMLAction()
Method Detail

parse

public void parse(Element e)
           throws IOException
Description copied from interface: OXMLAction
Parses the action from an XML configuration.

Parameters:
e - Configuration element for this action.
Throws:
IOException - If the element cannot be parsed

process

public void process(OXMLContext context)
Description copied from interface: OXMLAction
Processes the action against a context

Parameters:
context - Execution context

setProperty

protected void setProperty(Object instance,
                           Object propertyValue)
                    throws Exception
Sets the property on a instance, using the parameters of this action. If no setter is defined, the property is directly set on the instance using the property name. If a setter has been defined, a sub-instance is first accessed using the name property and the setter is then called on this sub-instance.

Parameters:
instance - Object to set the property on
propertyValue - Property value to set
Throws:
Exception - In case the property cannot be set
See Also:
Utils.getProperty(Object, String)

toEnum

protected Object toEnum(Object instance,
                        Object propertyValue)
Converts, if possible, the property value to a corresponding enumeration

Parameters:
instance - Current instance that will host the property value
propertyValue - Raw property value
Returns:
Initial property or property converted to an enumeration


Copyright © 2011. All Rights Reserved.