Top Description Methods
org.springframework.expression

public Interface MethodExecutor

Known Direct Implementers
org.springframework.expression.spel.support.ReflectiveMethodExecutor
Annotations
@FunctionalInterface

A MethodExecutor is built by a MethodResolver and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers.

For example, the particular method to execute on an object may be discovered by a MethodResolver which then builds a MethodExecutor that executes that method, and the resolved MethodExecutor can be reused without needing to go back to the resolvers to discover the method again.

If a MethodExecutor becomes stale, it should throw an AccessException which signals to the infrastructure to go back to the resolvers to ask for a new one.

Authors
Andy Clement, Sam Brannen
Since
3.0
See Also
MethodResolver, ConstructorExecutor

Method Summary

Modifier and TypeMethod and Description
public TypedValue

Returns:

the value returned from the method
execute
(EvaluationContext
the evaluation context in which the method is being executed
context
,
Object
the target of the method invocation; may be null for static methods
target
,
Object...
the arguments to the method; should match (in terms of number and type) whatever the method will need to run
arguments
)

Execute a method in the specified context using the specified arguments.

Method Detail

executeback to summary
public TypedValue execute(EvaluationContext context, Object target, Object... arguments) throws AccessException

Execute a method in the specified context using the specified arguments.

Parameters
context:EvaluationContext

the evaluation context in which the method is being executed

target:Object

the target of the method invocation; may be null for static methods

arguments:Object[]

the arguments to the method; should match (in terms of number and type) whatever the method will need to run

Returns:TypedValue

the value returned from the method

Exceptions
AccessException:
if there is a problem executing the method or if this MethodExecutor has become stale