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,
Object obj,
String name,
Object[] args)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
execute(Object o,
Object[] args)
Invokes the method to be executed.
|
protected Object[] |
handleVarArg(Class<?> type,
int index,
Object[] actual)
Reassembles arguments if the method is a vararg method.
|
Object |
tryExecute(String name,
Object obj,
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, Object obj, String name, Object[] args)
is
- the introspector used to discover the methodobj
- the object to find the method inname
- the method nameargs
- the method argumentspublic Object execute(Object o, Object[] args) throws IllegalAccessException, InvocationTargetException
execute
in class AbstractExecutor.Method
o
- the object to invoke the method uponargs
- the method argumentsIllegalAccessException
- Method is inaccessible.InvocationTargetException
- Method body throws an exception.public Object tryExecute(String name, Object obj, Object[] args)
tryExecute
in class AbstractExecutor.Method
name
- the method nameobj
- the object to invoke the method uponargs
- the method argumentsprotected Object[] handleVarArg(Class<?> type, int index, 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 © 2016 Internet2. All rights reserved.