public final class MethodExecutor extends AbstractExecutor.Method
AbstractExecutor.Method.Parameter
AbstractExecutor.Get, AbstractExecutor.Method, AbstractExecutor.Set
key
method, objectClass, TRY_FAILED
Constructor and Description |
---|
MethodExecutor(Introspector is,
java.lang.Object obj,
java.lang.String name,
java.lang.Object[] args)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.lang.Object o,
java.lang.Object[] args)
Invokes the method to be executed.
|
protected java.lang.Object[] |
handleVarArg(java.lang.Class<?> type,
int index,
java.lang.Object[] actual)
Reassembles arguments if the method is a vararg method.
|
java.lang.Object |
tryExecute(java.lang.String name,
java.lang.Object obj,
java.lang.Object[] args)
Tries to reuse this executor, checking that it is compatible with
the actual set of arguments.
|
getReturnType, getTargetProperty, invoke, tryInvoke
equals, equals, getMethod, getMethodName, getTargetClass, hashCode, isAlive, isCacheable, tryFailed
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isCacheable, tryFailed
public MethodExecutor(Introspector is, java.lang.Object obj, java.lang.String name, java.lang.Object[] args)
is
- the introspector used to discover the methodobj
- the object to find the method inname
- the method nameargs
- the method argumentspublic java.lang.Object execute(java.lang.Object o, java.lang.Object[] args) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
execute
in class AbstractExecutor.Method
o
- the object to invoke the method uponargs
- the method argumentsjava.lang.IllegalAccessException
- Method is inaccessible.java.lang.reflect.InvocationTargetException
- Method body throws an exception.public java.lang.Object tryExecute(java.lang.String name, java.lang.Object obj, java.lang.Object[] args)
tryExecute
in class AbstractExecutor.Method
name
- the method nameobj
- the object to invoke the method uponargs
- the method argumentsprotected java.lang.Object[] handleVarArg(java.lang.Class<?> type, int index, java.lang.Object[] actual)
type
- The vararg class type (aka component type
of the expected array arg)index
- The index of the vararg in the method declaration
(This will always be one less than the number of
expected arguments.)actual
- The actual parameters being passed to this methodCopyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.