类 ReflectiveMethodExecutor
java.lang.Object
cn.taketoday.expression.spel.support.ReflectiveMethodExecutor
- 所有已实现的接口:
MethodExecutor
MethodExecutor that works via reflection.- 从以下版本开始:
- 4.0
- 作者:
- Andy Clement, Juergen Hoeller
-
字段概要
字段 -
构造器概要
构造器构造器说明ReflectiveMethodExecutor(Method method) Create a new executor for the given method.ReflectiveMethodExecutor(Method method, Class<?> targetClass) Create a new executor for the given method. -
方法概要
修饰符和类型方法说明booleanprivate Class<?>discoverPublicDeclaringClass(Method method, Class<?> clazz) execute(EvaluationContext context, Object target, Object... arguments) Execute a command using the specified arguments, and using the specified expression state.final MethodReturn the original method that this executor has been configured for.Class<?>Find the first public class in the methods declaring class hierarchy that declares this method.
-
字段详细资料
-
originalMethod
-
methodToInvoke
-
varargsPosition
-
computedPublicDeclaringClass
private boolean computedPublicDeclaringClass -
publicDeclaringClass
-
argumentConversionOccurred
private boolean argumentConversionOccurred
-
-
构造器详细资料
-
ReflectiveMethodExecutor
Create a new executor for the given method.- 参数:
method- the method to invoke
-
ReflectiveMethodExecutor
Create a new executor for the given method.- 参数:
method- the method to invoketargetClass- the target class to invoke the method on
-
-
方法详细资料
-
getMethod
Return the original method that this executor has been configured for. -
getPublicDeclaringClass
Find the first public class in the methods declaring class hierarchy that declares this method. Sometimes the reflective method discovery logic finds a suitable method that can easily be called via reflection but cannot be called from generated code when compiling the expression because of visibility restrictions. For example if a non-public class overrides toString(), this helper method will walk up the type hierarchy to find the first public type that declares the method (if there is one!). For toString() it may walk as far as Object. -
discoverPublicDeclaringClass
-
didArgumentConversionOccur
public boolean didArgumentConversionOccur() -
execute
public TypedValue execute(EvaluationContext context, Object target, Object... arguments) throws AccessException 从接口复制的说明:MethodExecutorExecute a command using the specified arguments, and using the specified expression state.- 指定者:
execute在接口中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 run- 返回:
- the value returned from execution
- 抛出:
AccessException- if there is a problem executing the command or the MethodExecutor is no longer valid
-