public class Invocation
extends java.lang.Object
Evaluator
s.Constructor and Description |
---|
Invocation(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.Object[] args)
Create an invocation of the given method on the given object with the
given arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
evaluate()
Evaluate the return value (or a possibly thrown
Throwable )
by invoking to method with the arguments on the wrapped object. |
java.lang.Object[] |
getArguments()
Get the arguments for the invoked method.
|
java.lang.reflect.Method |
getMethod()
Get the invoked method.
|
java.lang.Object |
getObject()
Get the object this invocation is evaluated on.
|
java.lang.Object |
getResult()
Get the result of evaluation
|
java.lang.Throwable |
getThrowable()
Get the throwable thrown on evaluation.
|
boolean |
isEvaluated()
Test if this invocation is already evaluated.
|
java.lang.Object |
resultOrThrow()
Get the result or throwable of this invocation's evaluation.
|
void |
setArguments(java.lang.Object[] args)
Set the arguments for the invoked method.
|
void |
setMethod(java.lang.reflect.Method method)
Set the method to invoke.
|
void |
setObject(java.lang.Object object)
Set the object this invocation is evaluated on.
|
void |
setResult(java.lang.Object result)
Set the result of evaluation
|
void |
setThrowable(java.lang.Throwable throwable)
Set the throwable thrown on evaluation.
|
public Invocation(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args)
object
- object to invoke method onmethod
- method to invokeargs
- arguments for the method invocationpublic void setObject(java.lang.Object object)
object
- object to evaluate onpublic java.lang.Object getObject()
public void setMethod(java.lang.reflect.Method method)
method
- method to invokepublic java.lang.reflect.Method getMethod()
public void setArguments(java.lang.Object[] args)
args
- the arguments for the invoked methodpublic java.lang.Object[] getArguments()
public java.lang.Object getResult()
public void setResult(java.lang.Object result)
result
- the resultpublic java.lang.Throwable getThrowable()
public void setThrowable(java.lang.Throwable throwable)
throwable
- the throwablepublic void evaluate()
Throwable
)
by invoking to method with the arguments on the wrapped object.public boolean isEvaluated()
true
if evaluation has finishedpublic java.lang.Object resultOrThrow() throws java.lang.Throwable
java.lang.Throwable
- throwable of evaluation