Class DataBindingMethodResolver
- java.lang.Object
- org.springframework.expression.spel.support.ReflectiveMethodResolver
- org.springframework.expression.spel.support.DataBindingMethodResolver
- All Implemented Interfaces:
MethodResolver
public class DataBindingMethodResolver extends ReflectiveMethodResolver
AMethodResolver
variant for data binding purposes, using reflection to access instance methods on a given target object.This accessor does not resolve static methods and also no technical methods on
java.lang.Object
orjava.lang.Class
. For unrestricted resolution, chooseReflectiveMethodResolver
instead.- Since:
- 4.3.15
- Author:
- Juergen Hoeller
- See Also:
forInstanceMethodInvocation()
,DataBindingPropertyAccessor
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataBindingMethodResolver
forInstanceMethodInvocation()
Create a new data-binding method resolver for instance method resolution.protected boolean
isCandidateForInvocation(Method method, Class<?> targetClass)
Determine whether the givenMethod
is a candidate for method resolution on an instance of the given target class.MethodExecutor
resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes)
Locate a method on a type.Methods inherited from class org.springframework.expression.spel.support.ReflectiveMethodResolver
getMethods, registerMethodFilter
Method Detail
resolve
public MethodExecutor resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes) throws AccessException
Description copied from class:ReflectiveMethodResolver
Locate a method on a type. There are three kinds of match that might occur:- an exact match where the types of the arguments match the types of the constructor
- an in-exact match where the types we are looking for are subtypes of those defined on the constructor
- a match where we are able to convert the arguments into those expected by the constructor, according to the registered type converter
- Specified by:
resolve
in interfaceMethodResolver
- Overrides:
resolve
in classReflectiveMethodResolver
- Parameters:
context
- the current evaluation contexttargetObject
- the object upon which the method is being calledargumentTypes
- the arguments that the constructor must be able to handle- Returns:
- a MethodExecutor that can invoke the method, or null if the method cannot be found
- Throws:
AccessException
isCandidateForInvocation
protected boolean isCandidateForInvocation(Method method, Class<?> targetClass)
Description copied from class:ReflectiveMethodResolver
Determine whether the givenMethod
is a candidate for method resolution on an instance of the given target class.The default implementation considers any method as a candidate, even for static methods sand non-user-declared methods on the
Object
base class.- Overrides:
isCandidateForInvocation
in classReflectiveMethodResolver
- Parameters:
method
- the Method to evaluatetargetClass
- the concrete target class that is being introspected
forInstanceMethodInvocation
public static DataBindingMethodResolver forInstanceMethodInvocation()
Create a new data-binding method resolver for instance method resolution.