MethodResolver used by default in StandardEvaluationContext
unless explicit method resolvers have been specified.
StandardEvaluationContext#addMethodResolver(MethodResolver)
| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ReflectiveMethodResolver(boolean
true if distance computation should be used when
calculating matches; false otherwiseThis constructor allows the ReflectiveMethodResolver to be configured such that it will use a distance computation to check which is the better of two close matches (when there are multiple matches). |
| Modifier and Type | Method and Description |
|---|---|
| private Set | |
| protected Method[] | getMethods(Class<?>
the class for which to return the methods type)Return the set of methods for this type. |
| protected boolean | isCandidateForInvocation(Method
the Method to evaluate method, Class<?> the concrete target class that is being introspected targetClass)Determine whether the given |
| public void | registerMethodFilter(Class<?>
the type to filter on type, MethodFilter the corresponding method filter,
or filter)null to clear any filter for the given typeRegister a filter for methods on the given type. |
| 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)Implements org. Locate a method on the type. |
| filters | back to summary |
|---|---|
| private Map<Class<?>, MethodFilter> filters
| |
| useDistance | back to summary |
|---|---|
| private final boolean useDistance | |
| ReflectiveMethodResolver | back to summary |
|---|---|
| public ReflectiveMethodResolver() | |
| ReflectiveMethodResolver | back to summary |
|---|---|
| public ReflectiveMethodResolver(boolean useDistance) This constructor allows the ReflectiveMethodResolver to be configured such that it will use a distance computation to check which is the better of two close matches (when there are multiple matches). Using the distance computation is intended to ensure matches are more closely representative of what a Java compiler would do when taking into account boxing/unboxing and whether the method candidates are declared to handle a supertype of the type (of the argument) being passed in.
| |
| getMethods | back to summary |
|---|---|
| private Set | |
| getMethods | back to summary |
|---|---|
| protected Method[] getMethods(Class<?> type) Return the set of methods for this type. The default implementation returns the
result of
| |
| isCandidateForInvocation | back to summary |
|---|---|
| protected boolean isCandidateForInvocation(Method method, Class<?> targetClass) Determine whether the given The default implementation considers any method as a candidate, even for
static methods and non-user-declared methods on the | |
| registerMethodFilter | back to summary |
|---|---|
| public void registerMethodFilter(Class<?> type, MethodFilter filter) Register a filter for methods on the given type.
| |
| resolve | back to summary |
|---|---|
| public MethodExecutor resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes) throws AccessException Implements org. Locate a method on the type. There are three kinds of matches that might occur:
| |