Top Description Constructors Methods
org.springframework.expression.spel.support

public final Class DataBindingMethodResolver

extends ReflectiveMethodResolver
Class Inheritance
Imports
java.lang.reflect.Method, .Modifier, java.util.List, org.springframework.core.convert.TypeDescriptor, org.springframework.expression.AccessException, .EvaluationContext, .MethodExecutor, org.springframework.lang.Nullable

An org.springframework.expression.MethodResolver 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 or java.lang.Class. For unrestricted resolution, choose ReflectiveMethodResolver instead.

Author
Juergen Hoeller
Since
4.3.15
See Also
forInstanceMethodInvocation(), DataBindingPropertyAccessor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static DataBindingMethodResolver
forInstanceMethodInvocation()

Create a new data-binding method resolver for instance method resolution.

protected boolean
isCandidateForInvocation(Method
the Method to evaluate
method
,
Class<?>
the concrete target class that is being introspected
targetClass
)

Overrides org.springframework.expression.spel.support.ReflectiveMethodResolver.isCandidateForInvocation.

Determine whether the given Method is a candidate for method resolution on an instance of the given target class.

public MethodExecutor
resolve(EvaluationContext
the current evaluation context
context
,
Object
the object upon which the method is being called
targetObject
,
String
the name of the method
name
,
List<TypeDescriptor>
the types of arguments that the method must be able to handle
argumentTypes
)

Overrides org.springframework.expression.spel.support.ReflectiveMethodResolver.resolve.

Implements org.springframework.expression.MethodResolver.resolve.

Locate a method on the type.

Inherited from org.springframework.expression.spel.support.ReflectiveMethodResolver:
getMethodsregisterMethodFilter

Constructor Detail

DataBindingMethodResolverback to summary
private DataBindingMethodResolver()

Method Detail

forInstanceMethodInvocationback to summary
public static DataBindingMethodResolver forInstanceMethodInvocation()

Create a new data-binding method resolver for instance method resolution.

isCandidateForInvocationback to summary
protected boolean isCandidateForInvocation(Method method, Class<?> targetClass)

Overrides org.springframework.expression.spel.support.ReflectiveMethodResolver.isCandidateForInvocation.

Doc from org.springframework.expression.spel.support.ReflectiveMethodResolver.isCandidateForInvocation.

Determine whether the given Method 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 and non-user-declared methods on the Object base class.

Parameters
method:Method

the Method to evaluate

targetClass:Class<?>

the concrete target class that is being introspected

Annotations
@Override
resolveback to summary
public MethodExecutor resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes) throws AccessException

Overrides org.springframework.expression.spel.support.ReflectiveMethodResolver.resolve.

Implements org.springframework.expression.MethodResolver.resolve.

Doc from org.springframework.expression.spel.support.ReflectiveMethodResolver.resolve.

Locate a method on the type.

There are three kinds of matches that might occur:

  1. An exact match where the types of the arguments match the types of the method.
  2. An inexact match where the types we are looking for are subtypes of those defined on the method.
  3. A match where we are able to convert the arguments into those expected by the method, according to the registered type converter.
Parameters
context:EvaluationContext

Doc from org.springframework.expression.MethodResolver.resolve.

the current evaluation context

targetObject:Object

Doc from org.springframework.expression.MethodResolver.resolve.

the object upon which the method is being called

name:String

Doc from org.springframework.expression.MethodResolver.resolve.

the name of the method

argumentTypes:List<TypeDescriptor>

Doc from org.springframework.expression.MethodResolver.resolve.

the types of arguments that the method must be able to handle

Returns:MethodExecutor

Doc from org.springframework.expression.MethodResolver.resolve.

a MethodExecutor that can invoke the method, or null if the method cannot be found

Annotations
@Override
@Nullable