com.glaivestone.javax.execution
Class InstanceMethodAction

java.lang.Object
  |
  +--com.glaivestone.javax.execution.AbstractEvaluableAction
        |
        +--com.glaivestone.javax.execution.MessageAction
              |
              +--com.glaivestone.javax.execution.InstanceMethodAction
All Implemented Interfaces:
EvaluableAction

public class InstanceMethodAction
extends MessageAction

An evaluable action which sends an instance message to an object.

A number of static create factory methods are provided to make it easy to construct the common flavors of instance method actions. The creation services provide the notational simplicity of one-line expressions in initialization logic for common cases.

Author:
Deb Lewis

Field Summary
 
Fields inherited from class com.glaivestone.javax.execution.AbstractEvaluableAction
CONTINUABLE_HANDLER, DEFAULT_HANDLER, EMPTY_ARGS, EMPTY_PARM_TYPES, PROPAGATING_HANDLER, TERMINATING_HANDLER
 
Constructor Summary
InstanceMethodAction(java.lang.Object receiver, java.lang.reflect.Method aMethod, java.lang.Object[] arguments, ExceptionHandler exceptionHandler)
          Construct a new InstanceMethodAction which sends the instance message aMethod to the receiver object.
 
Method Summary
static InstanceMethodAction create(java.lang.Object anInstance, java.lang.reflect.Method aMethod, java.lang.Object[] args)
          Create an action which will send the message represented by aMethod to anInstance with the argument values in args when it is evaluated.
static InstanceMethodAction create(java.lang.Object anInstance, java.lang.String selector)
          Create an action which will send the no-argument message selector to anInstance when it is evaluated.
static InstanceMethodAction create(java.lang.Object anInstance, java.lang.String selector, java.lang.Class[] parmTypes)
          Create an action which will send the message selector with the argument type signature specified by the parmTypes argument types list to anInstance when it is evaluated.
static InstanceMethodAction create(java.lang.Object anInstance, java.lang.String selector, java.lang.Class[] parmTypes, java.lang.Object[] args)
           
static java.lang.reflect.Method findMethod(java.lang.Object anInstance, java.lang.String selector)
          Answer the public no-argument instance method named selector supported by anInstance.
static java.lang.reflect.Method findMethod(java.lang.Object anInstance, java.lang.String selector, java.lang.Class[] parmTypes)
          Answer the public instance method named selector with the argument type signature specified by the parmTypes argument types list which is supported by anInstance.
 
Methods inherited from class com.glaivestone.javax.execution.MessageAction
evaluate, getMethod, getSelector, toString
 
Methods inherited from class com.glaivestone.javax.execution.AbstractEvaluableAction
evaluate, evaluate, evaluate, getArguments, getNumberOfArguments, getOriginalException, getReceiver, setArguments, setExceptionHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstanceMethodAction

public InstanceMethodAction(java.lang.Object receiver,
                            java.lang.reflect.Method aMethod,
                            java.lang.Object[] arguments,
                            ExceptionHandler exceptionHandler)
Construct a new InstanceMethodAction which sends the instance message aMethod to the receiver object. The default arguments are used if argument values are not supplied dynamically when the action is evaluated.

Method Detail

create

public static InstanceMethodAction create(java.lang.Object anInstance,
                                          java.lang.String selector)
Create an action which will send the no-argument message selector to anInstance when it is evaluated.


create

public static InstanceMethodAction create(java.lang.Object anInstance,
                                          java.lang.String selector,
                                          java.lang.Class[] parmTypes)
Create an action which will send the message selector with the argument type signature specified by the parmTypes argument types list to anInstance when it is evaluated.

The client must provide the argument values when the action is evaluated.


create

public static InstanceMethodAction create(java.lang.Object anInstance,
                                          java.lang.String selector,
                                          java.lang.Class[] parmTypes,
                                          java.lang.Object[] args)

create

public static InstanceMethodAction create(java.lang.Object anInstance,
                                          java.lang.reflect.Method aMethod,
                                          java.lang.Object[] args)
Create an action which will send the message represented by aMethod to anInstance with the argument values in args when it is evaluated.

The client may override the default argument values of the action by providing actual argument values when the action is evaluated.


findMethod

public static java.lang.reflect.Method findMethod(java.lang.Object anInstance,
                                                  java.lang.String selector)
Answer the public no-argument instance method named selector supported by anInstance.


findMethod

public static java.lang.reflect.Method findMethod(java.lang.Object anInstance,
                                                  java.lang.String selector,
                                                  java.lang.Class[] parmTypes)
Answer the public instance method named selector with the argument type signature specified by the parmTypes argument types list which is supported by anInstance.


GFL 1.1 API