com.glaivestone.javax.execution
Interface EvaluableAction

All Known Implementing Classes:
AbstractEvaluableAction

public interface EvaluableAction

An evaluable action provides for dynamic evaluation of messages and code expressions. Argument values can be specified either when the action is constructed or at evaluation time. Actual argument values provided at evaluation time override any default argument values defined when the evaluable action was constructed.

By default, the unchecked exception PropagatedException is raised when evaluation fails to allow the cause of a failure to be propagated to the calling context. Alternate exception handling behavior can be configured by using the setExceptionHandler message to specify an alternative ExceptionHandler for the action.

Origins

The evaluable action mechanisms are an attempt to provide a Java facility with the notational simplicity of Smalltalk facilities for configuring dynamic behavior and evaluating messages and code blocks.

Author:
Deb Lewis

Method Summary
 java.lang.Object evaluate()
          Answer the result of evaluating the action.
 java.lang.Object evaluate(java.lang.Object anArg)
          Answer the result of evaluating the active with the given argument value.
 java.lang.Object evaluate(java.lang.Object[] args)
          Answer the result of evaluating the action with the given argument values.
 java.lang.Object evaluate(java.lang.Object arg1, java.lang.Object arg2)
          Answer the result of evaluating the action with the given argument values.
 java.lang.Object[] getArguments()
          Answer the default arguments used for evaluating the action.
 java.lang.Object getReceiver()
          Answer the object which performs the evaluation.
 java.lang.String getSelector()
          Answer the name of the action.
 void setArguments(java.lang.Object[] arguments)
          Specify the default arguments used for evaluating the action.
 void setExceptionHandler(ExceptionHandler aHandler)
          Set the evaluation exception handler for this action.
 

Method Detail

evaluate

public java.lang.Object evaluate()
Answer the result of evaluating the action.

Throws:
PropagatedException - if an exception occurs which is not handled by the action's exception handler

evaluate

public java.lang.Object evaluate(java.lang.Object anArg)
Answer the result of evaluating the active with the given argument value.

Throws:
PropagatedException - if an exception occurs which is not handled by the action's exception handler

evaluate

public java.lang.Object evaluate(java.lang.Object arg1,
                                 java.lang.Object arg2)
Answer the result of evaluating the action with the given argument values.

Throws:
PropagatedException - if an exception occurs which is not handled by the action's exception handler

evaluate

public java.lang.Object evaluate(java.lang.Object[] args)
Answer the result of evaluating the action with the given argument values.

Throws:
PropagatedException - if an exception occurs which is not handled by the action's exception handler

getArguments

public java.lang.Object[] getArguments()
Answer the default arguments used for evaluating the action. Returns null if no default arguments were specified when the action was constructed.

The actual arguments used for evaluating the receiver will differ from the default argument values defined for the action if the client provides argument values at invocation time.


getReceiver

public java.lang.Object getReceiver()
Answer the object which performs the evaluation.


getSelector

public java.lang.String getSelector()
Answer the name of the action. This is usually a message selector.


setArguments

public void setArguments(java.lang.Object[] arguments)
Specify the default arguments used for evaluating the action.

The default arguments are used if the client does not provide argument values at invocation time.


setExceptionHandler

public void setExceptionHandler(ExceptionHandler aHandler)
Set the evaluation exception handler for this action.

The actual arguments used for evaluating the receiver will differ from the default argument values defined for the action if the client provides argument values at invocation time.


GFL 1.1 API