planetj.dataengine.action
Class ReflectAction

java.lang.Object
  extended byplanetj.dataengine.action.AbstractAction
      extended byplanetj.dataengine.action.ReflectAction
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ReflectRowAction, ReflectRowCollectionAction

public abstract class ReflectAction
extends AbstractAction

A ReflectAction uses java reflection to invoke a method on a given Object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class planetj.dataengine.action.AbstractAction
DEFAULT_TYPE
 
Constructor Summary
ReflectAction(java.lang.Class c, java.lang.String methodName)
          ReflectAction constructor.
ReflectAction(java.lang.Class c, java.lang.String methodName, java.lang.Class[] parameterTypes)
          ReflectMethodRowAction constructor.
ReflectAction(java.lang.String methodName)
          ReflectMethodRowAction constructor.
ReflectAction(java.lang.String methodName, java.lang.Class[] parameterTypes)
          ReflectMethodRowAction constructor.
 
Method Summary
 java.lang.Class getMethodClass()
          Gets the Class containing the method to reflect.
 java.lang.String getMethodName()
          Gets the name of the method this action should reflect on a given Row.
 java.lang.String getName()
          Get the action's name.
 java.lang.Class[] getParameterTypes()
          Gets the parameter types classes to use when reflecting on a Row's method..
 java.lang.Object handleAction(java.lang.Object o, ExecutingContext ec)
          Refects this action's method on the given object.
 java.lang.Object handleAction(java.lang.Object o, java.lang.Object[] args, ExecutingContext ec)
          Uses java reflection to invoke this action's method on the given Object.
 void setMethodClass(java.lang.Class c)
          Sets the Class contianing the method to reflect.
 void setMethodName(java.lang.String methodName)
          Sets the name of the method this action should reflect on a given Row.
 void setParameterTypes(java.lang.Class[] parameterTypes)
          Sets the parameter types the method this action should use when reflecting on a given Row.
 
Methods inherited from class planetj.dataengine.action.AbstractAction
clone, cloneAction, getDefaultDescriptor, getDefaultLocation, getDescriptor, getDetailsLocations, getDetailsModes, getLocation, getLocations, getType, handleAction, handleAction, setDescriptor
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectAction

public ReflectAction(java.lang.Class c,
                     java.lang.String methodName)
ReflectAction constructor.

Parameters:
c - class containing method
methodName - name of method to reflect

ReflectAction

public ReflectAction(java.lang.Class c,
                     java.lang.String methodName,
                     java.lang.Class[] parameterTypes)
ReflectMethodRowAction constructor.

Parameters:
c - class containing method
methodName - name of method to reflect on the Row
parameterTypes - array of class types for method parameters

ReflectAction

public ReflectAction(java.lang.String methodName)
ReflectMethodRowAction constructor.

Parameters:
methodName - name of method to reflect on the Row

ReflectAction

public ReflectAction(java.lang.String methodName,
                     java.lang.Class[] parameterTypes)
ReflectMethodRowAction constructor.

Parameters:
methodName - name of method to reflect on the Row
Method Detail

getName

public java.lang.String getName()
Get the action's name.

Specified by:
getName in class AbstractAction

getMethodClass

public java.lang.Class getMethodClass()
Gets the Class containing the method to reflect.

Returns:
class contianing method

getMethodName

public java.lang.String getMethodName()
Gets the name of the method this action should reflect on a given Row.

Returns:
name of method to reflect on Row.

getParameterTypes

public java.lang.Class[] getParameterTypes()
Gets the parameter types classes to use when reflecting on a Row's method..

Returns:
parameter types.

handleAction

public final java.lang.Object handleAction(java.lang.Object o,
                                           ExecutingContext ec)
                                    throws CMException
Refects this action's method on the given object. If the method to be used for reflection requires parameters, then handleAction(Object, Object[]) should be used.

Specified by:
handleAction in class AbstractAction
Parameters:
o - Object to perform the action on
Throws:
CMException

handleAction

public java.lang.Object handleAction(java.lang.Object o,
                                     java.lang.Object[] args,
                                     ExecutingContext ec)
                              throws CMException
Uses java reflection to invoke this action's method on the given Object. No Object is required if invoking a static method on an Object, provided a Class was specified during this action's instance creation.

Parameters:
o - Object to reflect method on
Throws:
CMException

setMethodClass

public void setMethodClass(java.lang.Class c)
Sets the Class contianing the method to reflect.


setMethodName

public void setMethodName(java.lang.String methodName)
Sets the name of the method this action should reflect on a given Row.

Parameters:
methodName - name of method to reflect on Row.

setParameterTypes

public void setParameterTypes(java.lang.Class[] parameterTypes)
Sets the parameter types the method this action should use when reflecting on a given Row.

Parameters:
parameterTypes - array of classes for method.