public class ReflectiveMethodExecutor extends java.lang.Object implements MethodExecutor
MethodExecutor
that works via reflection.Modifier and Type | Field and Description |
---|---|
private boolean |
argumentConversionOccurred |
private boolean |
computedPublicDeclaringClass |
private java.lang.reflect.Method |
methodToInvoke |
private java.lang.reflect.Method |
originalMethod |
private java.lang.Class<?> |
publicDeclaringClass |
private java.lang.Integer |
varargsPosition |
Constructor and Description |
---|
ReflectiveMethodExecutor(java.lang.reflect.Method method)
Create a new executor for the given method.
|
Modifier and Type | Method and Description |
---|---|
boolean |
didArgumentConversionOccur() |
private java.lang.Class<?> |
discoverPublicDeclaringClass(java.lang.reflect.Method method,
java.lang.Class<?> clazz) |
TypedValue |
execute(EvaluationContext context,
java.lang.Object target,
java.lang.Object... arguments)
Execute a command using the specified arguments, and using the specified expression state.
|
java.lang.reflect.Method |
getMethod()
Return the original method that this executor has been configured for.
|
java.lang.Class<?> |
getPublicDeclaringClass()
Find the first public class in the methods declaring class hierarchy that declares this method.
|
private final java.lang.reflect.Method originalMethod
private final java.lang.reflect.Method methodToInvoke
@Nullable private final java.lang.Integer varargsPosition
private boolean computedPublicDeclaringClass
@Nullable private java.lang.Class<?> publicDeclaringClass
private boolean argumentConversionOccurred
public ReflectiveMethodExecutor(java.lang.reflect.Method method)
method
- the method to invokepublic final java.lang.reflect.Method getMethod()
@Nullable public java.lang.Class<?> getPublicDeclaringClass()
@Nullable private java.lang.Class<?> discoverPublicDeclaringClass(java.lang.reflect.Method method, java.lang.Class<?> clazz)
public boolean didArgumentConversionOccur()
public TypedValue execute(EvaluationContext context, java.lang.Object target, java.lang.Object... arguments) throws AccessException
MethodExecutor
execute
in interface MethodExecutor
context
- the evaluation context in which the command is being executedtarget
- the target object of the call - null for static methodsarguments
- the arguments to the executor, should match (in terms of number
and type) whatever the command will need to runAccessException
- if there is a problem executing the command or the
MethodExecutor is no longer valid