org.springframework.core

## 类 MethodIntrospector

- java.lang.Object
- - org.springframework.core.MethodIntrospector

-     public abstract class MethodIntrospector
      extends Object

  Defines the algorithm for searching for metadata-associated methods exhaustively including interfaces and parent classes while also dealing with parameterized methods as well as common scenarios encountered with interface and class-based proxies.

  Typically, but not necessarily, used for finding annotated handler methods.

  从以下版本开始:
    4.2.3
  作者:
    Juergen Hoeller, Rossen Stoyanchev

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 类和说明
    --- | ---
    `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.

    - ### 从类继承的方法 java.lang.Object

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

- - ### 构造器详细资料

    - #### MethodIntrospector

          public MethodIntrospector()

  - ### 方法详细资料

    - #### selectMethods

          public static <T> Map<Method,T> selectMethods(Class<?> targetType,
                                                        MethodIntrospector.MetadataLookup<T> metadataLookup)

      方法实现说明:传入class对象，以及metadataLookup接口来获取我们标注了@RequestMapping的方法集合，存放在 Map中
      参数:
        `targetType` - :我们的具体controller对象的class
        `metadataLookup:lambda注册的表达式接口` -

    - #### selectMethods

          public static Set<Method> selectMethods(Class<?> targetType,
                                                  ReflectionUtils.MethodFilter methodFilter)

      Select methods on the given target type based on a filter.

      Callers define methods of interest through the `MethodFilter` parameter.

      参数:
        `targetType` - the target type to search methods on
        `methodFilter` - a `MethodFilter` to help recognize handler methods of interest
      返回:
        the selected methods, or an empty set in case of no match

    - #### selectInvocableMethod

          public 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.

      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 check
        `targetType` - the target type to search methods on (typically an interface-based JDK proxy)
      返回:
        a corresponding invocable method on the target type
      抛出:
        `IllegalStateException` - if the given method is not invocable on the given target type (typically due to a proxy mismatch)