org.springframework.beans.support

## 类 ArgumentConvertingMethodInvoker

- java.lang.Object
- - org.springframework.util.MethodInvoker
  - - org.springframework.beans.support.ArgumentConvertingMethodInvoker

- 直接已知子类:
    MethodInvokingBean

      public class ArgumentConvertingMethodInvoker
      extends org.springframework.util.MethodInvoker

  Subclass of `MethodInvoker` that tries to convert the given arguments for the actual target method via a `TypeConverter`.

  Supports flexible argument conversions, in particular for invoking a specific overloaded method.

  从以下版本开始:
    1.1
  作者:
    Juergen Hoeller
  另请参阅:
    `AbstractNestablePropertyAccessor.convertIfNecessary(java.lang.String, java.lang.Object, java.lang.Object, java.lang.Class<?>, org.springframework.core.convert.TypeDescriptor)`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.util.MethodInvoker

      `targetClass`

  - ### 构造器概要

    构造器
    构造器和说明
    `ArgumentConvertingMethodInvoker()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Method` | `doFindMatchingMethod(Object[] arguments)` Actually find a method with matching parameter type, i.e. where each argument value is assignable to the corresponding parameter type.
    `protected Method` | `findMatchingMethod()` This implementation looks for a method with matching parameter types.
    `protected TypeConverter` | `getDefaultTypeConverter()` Obtain the default TypeConverter for this method invoker.
    `TypeConverter` | `getTypeConverter()` Return the TypeConverter used for argument type conversion.
    `void` | `registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor)` Register the given custom property editor for all properties of the given type.
    `void` | `setTypeConverter(TypeConverter typeConverter)` Set a TypeConverter to use for argument type conversion.

    - ### 从类继承的方法 org.springframework.util.MethodInvoker

      `getArguments, getPreparedMethod, getTargetClass, getTargetMethod, getTargetObject, getTypeDifferenceWeight, invoke, isPrepared, prepare, resolveClassName, setArguments, setStaticMethod, setTargetClass, setTargetMethod, setTargetObject`

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

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

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

    - #### ArgumentConvertingMethodInvoker

          public ArgumentConvertingMethodInvoker()

  - ### 方法详细资料

    - #### setTypeConverter

          public void setTypeConverter(@Nullable
                                       TypeConverter typeConverter)

      Set a TypeConverter to use for argument type conversion.

      Default is a `SimpleTypeConverter`. Can be overridden with any TypeConverter implementation, typically a pre-configured SimpleTypeConverter or a BeanWrapperImpl instance.

      另请参阅:
        `SimpleTypeConverter`, `BeanWrapperImpl`

    - #### getTypeConverter

          @Nullable
          public TypeConverter getTypeConverter()

      Return the TypeConverter used for argument type conversion.

      Can be cast to `PropertyEditorRegistry` if direct access to the underlying PropertyEditors is desired (provided that the present TypeConverter actually implements the PropertyEditorRegistry interface).

    - #### getDefaultTypeConverter

          protected TypeConverter getDefaultTypeConverter()

      Obtain the default TypeConverter for this method invoker.

      Called if no explicit TypeConverter has been specified. The default implementation builds a `SimpleTypeConverter`. Can be overridden in subclasses.

    - #### registerCustomEditor

          public void registerCustomEditor(Class<?> requiredType,
                                           PropertyEditor propertyEditor)

      Register the given custom property editor for all properties of the given type.

      Typically used in conjunction with the default `SimpleTypeConverter`; will work with any TypeConverter that implements the PropertyEditorRegistry interface as well.

      参数:
        `requiredType` - type of the property
        `propertyEditor` - editor to register
      另请参阅:
        `setTypeConverter(org.springframework.beans.TypeConverter)`, `PropertyEditorRegistry.registerCustomEditor(java.lang.Class<?>, java.beans.PropertyEditor)`

    - #### findMatchingMethod

          protected Method findMatchingMethod()

      This implementation looks for a method with matching parameter types.
      覆盖:
        `findMatchingMethod` 在类中 `org.springframework.util.MethodInvoker`
      另请参阅:
        `doFindMatchingMethod(java.lang.Object[])`

    - #### doFindMatchingMethod

          @Nullable
          protected Method doFindMatchingMethod(Object[] arguments)

      Actually find a method with matching parameter type, i.e. where each argument value is assignable to the corresponding parameter type.
      参数:
        `arguments` - the argument values to match against method parameters
      返回:
        a matching method, or `null` if none