Package org.springframework.expression.spel.support

# Class ReflectiveMethodExecutor

java.lang.Object
org.springframework.expression.spel.support.ReflectiveMethodExecutor

All Implemented Interfaces:
  `MethodExecutor`

public class ReflectiveMethodExecutor extends Object implements MethodExecutor
`MethodExecutor` that works via reflection.

Since:
  3.0
Author:
  Andy Clement, Juergen Hoeller, Sam Brannen

## Constructor Summary

Constructors
Constructor
Description
`ReflectiveMethodExecutor(Method method)`
Create a new executor for the given method.
`ReflectiveMethodExecutor(Method method, Class<?> targetClass)`
Create a new executor for the given method.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`didArgumentConversionOccur()`
`TypedValue`
`execute(EvaluationContext context, Object target, Object... arguments)`
Execute a method in the specified context using the specified arguments.
`final Method`
`getMethod()`
Return the original method that this executor has been configured for.
`Class<?>`
`getPublicDeclaringClass()`
Get the public class or interface in the method's type hierarchy that declares the original method.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ReflectiveMethodExecutor

public ReflectiveMethodExecutor(Method method)
Create a new executor for the given method.

Parameters:
  `method` - the method to invoke

### ReflectiveMethodExecutor

public ReflectiveMethodExecutor(Method method, @Nullable Class<?> targetClass)
Create a new executor for the given method.

Parameters:
  `method` - the method to invoke
  `targetClass` - the target class to invoke the method on, or `null` if unknown
Since:
  5.3.16

## Method Details

### getMethod

public final Method getMethod()
Return the original method that this executor has been configured for.

### getPublicDeclaringClass

@Nullable public Class<?> getPublicDeclaringClass()
Get the public class or interface in the method's type hierarchy that declares the original method.

See `ClassUtils.getPubliclyAccessibleMethodIfPossible(Method, Class)` for details.

Returns:
  the public class or interface that declares the method, or `null` if no such public type could be found

### didArgumentConversionOccur

public boolean didArgumentConversionOccur()

### execute

public TypedValue execute(EvaluationContext context, Object target, Object... arguments) throws AccessException
Description copied from interface: `MethodExecutor`
Execute a method in the specified context using the specified arguments.

Specified by:
  `execute` in interface `MethodExecutor`
Parameters:
  `context` - the evaluation context in which the method is being executed
  `target` - the target of the method invocation; may be `null` for `static` methods
  `arguments` - the arguments to the method; should match (in terms of number and type) whatever the method will need to run
Returns:
  the value returned from the method
Throws:
  `AccessException` - if there is a problem executing the method or if this `MethodExecutor` has become stale