org.springframework.beans.factory.config

## 类 ConstructorArgumentValues

- java.lang.Object
- - org.springframework.beans.factory.config.ConstructorArgumentValues

-     public class ConstructorArgumentValues
      extends Object

  Holder for constructor argument values, typically as part of a bean definition.

  Supports values for a specific index in the constructor argument list as well as for generic argument matches by type.

  从以下版本开始:
    09.11.2003
  作者:
    Juergen Hoeller
  另请参阅:
    `BeanDefinition.getConstructorArgumentValues()`

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 类和说明
    --- | ---
    `static class` | `ConstructorArgumentValues.ValueHolder` Holder for a constructor argument value, with an optional type attribute indicating the target type of the actual constructor argument.

  - ### 构造器概要

    构造器
    构造器和说明
    `ConstructorArgumentValues()` Create a new empty ConstructorArgumentValues object.
    `ConstructorArgumentValues(ConstructorArgumentValues original)` Deep copy constructor.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addArgumentValues(ConstructorArgumentValues other)` Copy all given argument values into this object, using separate holder instances to keep the values independent from the original object.
    `void` | `addGenericArgumentValue(ConstructorArgumentValues.ValueHolder newValue)` Add a generic argument value to be matched by type or name (if available).
    `void` | `addGenericArgumentValue(Object value)` Add a generic argument value to be matched by type.
    `void` | `addGenericArgumentValue(Object value, String type)` Add a generic argument value to be matched by type.
    `void` | `addIndexedArgumentValue(int index, ConstructorArgumentValues.ValueHolder newValue)` Add an argument value for the given index in the constructor argument list.
    `void` | `addIndexedArgumentValue(int index, Object value)` Add an argument value for the given index in the constructor argument list.
    `void` | `addIndexedArgumentValue(int index, Object value, String type)` Add an argument value for the given index in the constructor argument list.
    `void` | `clear()` Clear this holder, removing all argument values.
    `boolean` | `equals(Object other)`
    `int` | `getArgumentCount()` Return the number of argument values held in this instance, counting both indexed and generic argument values.
    `ConstructorArgumentValues.ValueHolder` | `getArgumentValue(int index, Class<?> requiredType)` Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
    `ConstructorArgumentValues.ValueHolder` | `getArgumentValue(int index, Class<?> requiredType, String requiredName)` Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
    `ConstructorArgumentValues.ValueHolder` | `getArgumentValue(int index, Class<?> requiredType, String requiredName, Set<ConstructorArgumentValues.ValueHolder> usedValueHolders)` Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
    `ConstructorArgumentValues.ValueHolder` | `getGenericArgumentValue(Class<?> requiredType)` Look for a generic argument value that matches the given type.
    `ConstructorArgumentValues.ValueHolder` | `getGenericArgumentValue(Class<?> requiredType, String requiredName)` Look for a generic argument value that matches the given type.
    `ConstructorArgumentValues.ValueHolder` | `getGenericArgumentValue(Class<?> requiredType, String requiredName, Set<ConstructorArgumentValues.ValueHolder> usedValueHolders)` Look for the next generic argument value that matches the given type, ignoring argument values that have already been used in the current resolution process.
    `List<ConstructorArgumentValues.ValueHolder>` | `getGenericArgumentValues()` Return the list of generic argument values.
    `ConstructorArgumentValues.ValueHolder` | `getIndexedArgumentValue(int index, Class<?> requiredType)` Get argument value for the given index in the constructor argument list.
    `ConstructorArgumentValues.ValueHolder` | `getIndexedArgumentValue(int index, Class<?> requiredType, String requiredName)` Get argument value for the given index in the constructor argument list.
    `Map<Integer,ConstructorArgumentValues.ValueHolder>` | `getIndexedArgumentValues()` Return the map of indexed argument values.
    `int` | `hashCode()`
    `boolean` | `hasIndexedArgumentValue(int index)` Check whether an argument value has been registered for the given index.
    `boolean` | `isEmpty()` Return if this holder does not contain any argument values, neither indexed ones nor generic ones.

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

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

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

    - #### ConstructorArgumentValues

          public ConstructorArgumentValues()

      Create a new empty ConstructorArgumentValues object.

    - #### ConstructorArgumentValues

          public ConstructorArgumentValues(ConstructorArgumentValues original)

      Deep copy constructor.
      参数:
        `original` - the ConstructorArgumentValues to copy

  - ### 方法详细资料

    - #### addArgumentValues

          public void addArgumentValues(@Nullable
                                        ConstructorArgumentValues other)

      Copy all given argument values into this object, using separate holder instances to keep the values independent from the original object.

      Note: Identical ValueHolder instances will only be registered once, to allow for merging and re-merging of argument value definitions. Distinct ValueHolder instances carrying the same content are of course allowed.

    - #### addIndexedArgumentValue

          public void addIndexedArgumentValue(int index,
                                              @Nullable
                                              Object value)

      Add an argument value for the given index in the constructor argument list.
      参数:
        `index` - the index in the constructor argument list
        `value` - the argument value

    - #### addIndexedArgumentValue

          public void addIndexedArgumentValue(int index,
                                              @Nullable
                                              Object value,
                                              String type)

      Add an argument value for the given index in the constructor argument list.
      参数:
        `index` - the index in the constructor argument list
        `value` - the argument value
        `type` - the type of the constructor argument

    - #### addIndexedArgumentValue

          public void addIndexedArgumentValue(int index,
                                              ConstructorArgumentValues.ValueHolder newValue)

      Add an argument value for the given index in the constructor argument list.
      参数:
        `index` - the index in the constructor argument list
        `newValue` - the argument value in the form of a ValueHolder

    - #### hasIndexedArgumentValue

          public boolean hasIndexedArgumentValue(int index)

      Check whether an argument value has been registered for the given index.
      参数:
        `index` - the index in the constructor argument list

    - #### getIndexedArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getIndexedArgumentValue(int index,
                                                                                          @Nullable
                                                                                          Class<?> requiredType)

      Get argument value for the given index in the constructor argument list.
      参数:
        `index` - the index in the constructor argument list
        `requiredType` - the type to match (can be `null` to match untyped values only)
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getIndexedArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getIndexedArgumentValue(int index,
                                                                                          @Nullable
                                                                                          Class<?> requiredType,
                                                                                          @Nullable
                                                                                          String requiredName)

      Get argument value for the given index in the constructor argument list.
      参数:
        `index` - the index in the constructor argument list
        `requiredType` - the type to match (can be `null` to match untyped values only)
        `requiredName` - the type to match (can be `null` to match unnamed values only, or empty String to match any name)
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getIndexedArgumentValues

          public Map<Integer,ConstructorArgumentValues.ValueHolder> getIndexedArgumentValues()

      Return the map of indexed argument values.
      返回:
        unmodifiable Map with Integer index as key and ValueHolder as value
      另请参阅:
        `ConstructorArgumentValues.ValueHolder`

    - #### addGenericArgumentValue

          public void addGenericArgumentValue(Object value)

      Add a generic argument value to be matched by type.

      Note: A single generic argument value will just be used once, rather than matched multiple times.

      参数:
        `value` - the argument value

    - #### addGenericArgumentValue

          public void addGenericArgumentValue(Object value,
                                              String type)

      Add a generic argument value to be matched by type.

      Note: A single generic argument value will just be used once, rather than matched multiple times.

      参数:
        `value` - the argument value
        `type` - the type of the constructor argument

    - #### addGenericArgumentValue

          public void addGenericArgumentValue(ConstructorArgumentValues.ValueHolder newValue)

      Add a generic argument value to be matched by type or name (if available).

      Note: A single generic argument value will just be used once, rather than matched multiple times.

      参数:
        `newValue` - the argument value in the form of a ValueHolder

        Note: Identical ValueHolder instances will only be registered once, to allow for merging and re-merging of argument value definitions. Distinct ValueHolder instances carrying the same content are of course allowed.

    - #### getGenericArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getGenericArgumentValue(Class<?> requiredType)

      Look for a generic argument value that matches the given type.
      参数:
        `requiredType` - the type to match
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getGenericArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getGenericArgumentValue(Class<?> requiredType,
                                                                                          String requiredName)

      Look for a generic argument value that matches the given type.
      参数:
        `requiredType` - the type to match
        `requiredName` - the name to match
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getGenericArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getGenericArgumentValue(@Nullable
                                                                                          Class<?> requiredType,
                                                                                          @Nullable
                                                                                          String requiredName,
                                                                                          @Nullable
                                                                                          Set<ConstructorArgumentValues.ValueHolder> usedValueHolders)

      Look for the next generic argument value that matches the given type, ignoring argument values that have already been used in the current resolution process.
      参数:
        `requiredType` - the type to match (can be `null` to find an arbitrary next generic argument value)
        `requiredName` - the name to match (can be `null` to not match argument values by name, or empty String to match any name)
        `usedValueHolders` - a Set of ValueHolder objects that have already been used in the current resolution process and should therefore not be returned again
      返回:
        the ValueHolder for the argument, or `null` if none found

    - #### getGenericArgumentValues

          public List<ConstructorArgumentValues.ValueHolder> getGenericArgumentValues()

      Return the list of generic argument values.
      返回:
        unmodifiable List of ValueHolders
      另请参阅:
        `ConstructorArgumentValues.ValueHolder`

    - #### getArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getArgumentValue(int index,
                                                                                   Class<?> requiredType)

      Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
      参数:
        `index` - the index in the constructor argument list
        `requiredType` - the parameter type to match
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getArgumentValue(int index,
                                                                                   Class<?> requiredType,
                                                                                   String requiredName)

      Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
      参数:
        `index` - the index in the constructor argument list
        `requiredType` - the parameter type to match
        `requiredName` - the parameter name to match
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getArgumentValue

          @Nullable
          public ConstructorArgumentValues.ValueHolder getArgumentValue(int index,
                                                                                   @Nullable
                                                                                   Class<?> requiredType,
                                                                                   @Nullable
                                                                                   String requiredName,
                                                                                   @Nullable
                                                                                   Set<ConstructorArgumentValues.ValueHolder> usedValueHolders)

      Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
      参数:
        `index` - the index in the constructor argument list
        `requiredType` - the parameter type to match (can be `null` to find an untyped argument value)
        `requiredName` - the parameter name to match (can be `null` to find an unnamed argument value, or empty String to match any name)
        `usedValueHolders` - a Set of ValueHolder objects that have already been used in the current resolution process and should therefore not be returned again (allowing to return the next generic argument match in case of multiple generic argument values of the same type)
      返回:
        the ValueHolder for the argument, or `null` if none set

    - #### getArgumentCount

          public int getArgumentCount()

      Return the number of argument values held in this instance, counting both indexed and generic argument values.

    - #### isEmpty

          public boolean isEmpty()

      Return if this holder does not contain any argument values, neither indexed ones nor generic ones.

    - #### clear

          public void clear()

      Clear this holder, removing all argument values.

    - #### equals

          public boolean equals(Object other)

      覆盖:
        `equals` 在类中 `Object`

    - #### hashCode

          public int hashCode()

      覆盖:
        `hashCode` 在类中 `Object`