public abstract class MethodIntrospector extends Object
Typically, but not necessarily, used for finding annotated handler methods.
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
MethodIntrospector.MetadataLookup<T>
A callback interface for metadata lookup on a given method.
|
| 构造器和说明 |
|---|
MethodIntrospector() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Method |
selectInvocableMethod(Method method,
Class<?> targetType)
Select an invocable method on the target type: either the given method itself
if actually exposed on the target type, or otherwise a corresponding method
on one of the target type's interfaces or on the target type itself.
|
static <T> Map<Method,T> |
selectMethods(Class<?> targetType,
MethodIntrospector.MetadataLookup<T> metadataLookup)
方法实现说明:传入class对象,以及metadataLookup接口来获取我们标注了@RequestMapping的方法集合,存放在
Map中
|
static Set<Method> |
selectMethods(Class<?> targetType,
ReflectionUtils.MethodFilter methodFilter)
Select methods on the given target type based on a filter.
|
public static <T> Map<Method,T> selectMethods(Class<?> targetType, MethodIntrospector.MetadataLookup<T> metadataLookup)
targetType - :我们的具体controller对象的classmetadataLookup:lambda注册的表达式接口 - public static Set<Method> selectMethods(Class<?> targetType, ReflectionUtils.MethodFilter methodFilter)
Callers define methods of interest through the MethodFilter parameter.
targetType - the target type to search methods onmethodFilter - a MethodFilter to help
recognize handler methods of interestpublic static Method selectInvocableMethod(Method method, Class<?> targetType)
Matches on user-declared interfaces will be preferred since they are likely to contain relevant metadata that corresponds to the method on the target class.
method - the method to checktargetType - the target type to search methods on
(typically an interface-based JDK proxy)IllegalStateException - if the given method is not invocable on the given
target type (typically due to a proxy mismatch)