org.springframework.beans.factory.config

## 类 TypedStringValue

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

- 所有已实现的接口:
    BeanMetadataElement

      public class TypedStringValue
      extends Object
      implements BeanMetadataElement

  Holder for a typed String value. Can be added to bean definitions in order to explicitly specify a target type for a String value, for example for collection elements.

  This holder will just store the String value and the target type. The actual conversion will be performed by the bean factory.

  从以下版本开始:
    1.2
  作者:
    Juergen Hoeller
  另请参阅:
    `BeanDefinition.getPropertyValues()`, `MutablePropertyValues.addPropertyValue(org.springframework.beans.PropertyValue)`

- - ### 构造器概要

    构造器
    构造器和说明
    `TypedStringValue(String value)` Create a new `TypedStringValue` for the given String value.
    `TypedStringValue(String value, Class<?> targetType)` Create a new `TypedStringValue` for the given String value and target type.
    `TypedStringValue(String value, String targetTypeName)` Create a new `TypedStringValue` for the given String value and target type.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `equals(Object other)`
    `Object` | `getSource()` 获取源对象,可能返回null Return the configuration source `Object` for this metadata element (may be `null`).
    `String` | `getSpecifiedTypeName()` Return the type name as actually specified for this particular value, if any.
    `Class<?>` | `getTargetType()` Return the type to convert to.
    `String` | `getTargetTypeName()` Return the type to convert to.
    `String` | `getValue()` Return the String value.
    `int` | `hashCode()`
    `boolean` | `hasTargetType()` Return whether this typed String value carries a target type .
    `boolean` | `isDynamic()` Return whether this value has been marked as dynamic.
    `Class<?>` | `resolveTargetType(ClassLoader classLoader)` Determine the type to convert to, resolving it from a specified class name if necessary.
    `void` | `setDynamic()` Mark this value as dynamic, i.e. as containing an expression and hence not being subject to caching.
    `void` | `setSource(Object source)` Set the configuration source `Object` for this metadata element.
    `void` | `setSpecifiedTypeName(String specifiedTypeName)` Set the type name as actually specified for this particular value, if any.
    `void` | `setTargetType(Class<?> targetType)` Set the type to convert to.
    `void` | `setTargetTypeName(String targetTypeName)` Specify the type to convert to.
    `void` | `setValue(String value)` Set the String value.
    `String` | `toString()`

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

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

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

    - #### TypedStringValue

          public TypedStringValue(@Nullable
                                  String value)

      Create a new `TypedStringValue` for the given String value.
      参数:
        `value` - the String value

    - #### TypedStringValue

          public TypedStringValue(@Nullable
                                  String value,
                                  Class<?> targetType)

      Create a new `TypedStringValue` for the given String value and target type.
      参数:
        `value` - the String value
        `targetType` - the type to convert to

    - #### TypedStringValue

          public TypedStringValue(@Nullable
                                  String value,
                                  String targetTypeName)

      Create a new `TypedStringValue` for the given String value and target type.
      参数:
        `value` - the String value
        `targetTypeName` - the type to convert to

  - ### 方法详细资料

    - #### setValue

          public void setValue(@Nullable
                               String value)

      Set the String value.

      Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.

      另请参阅:
        `PropertyPlaceholderConfigurer`

    - #### getValue

          @Nullable
          public String getValue()

      Return the String value.

    - #### setTargetType

          public void setTargetType(Class<?> targetType)

      Set the type to convert to.

      Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.

      另请参阅:
        `PropertyPlaceholderConfigurer`

    - #### getTargetType

          public Class<?> getTargetType()

      Return the type to convert to.

    - #### setTargetTypeName

          public void setTargetTypeName(@Nullable
                                        String targetTypeName)

      Specify the type to convert to.

    - #### getTargetTypeName

          @Nullable
          public String getTargetTypeName()

      Return the type to convert to.

    - #### hasTargetType

          public boolean hasTargetType()

      Return whether this typed String value carries a target type .

    - #### resolveTargetType

          @Nullable
          public Class<?> resolveTargetType(@Nullable
                                                       ClassLoader classLoader)
                                                throws ClassNotFoundException

      Determine the type to convert to, resolving it from a specified class name if necessary. Will also reload a specified Class from its name when called with the target type already resolved.
      参数:
        `classLoader` - the ClassLoader to use for resolving a (potential) class name
      返回:
        the resolved type to convert to
      抛出:
        `ClassNotFoundException` - if the type cannot be resolved

    - #### setSource

          public void setSource(@Nullable
                                Object source)

      Set the configuration source `Object` for this metadata element.

      The exact type of the object will depend on the configuration mechanism used.

    - #### getSource

          @Nullable
          public Object getSource()

      从接口复制的说明: `BeanMetadataElement`
      获取源对象,可能返回null Return the configuration source `Object` for this metadata element (may be `null`).
      指定者:
        `getSource` 在接口中 `BeanMetadataElement`

    - #### setSpecifiedTypeName

          public void setSpecifiedTypeName(@Nullable
                                           String specifiedTypeName)

      Set the type name as actually specified for this particular value, if any.

    - #### getSpecifiedTypeName

          @Nullable
          public String getSpecifiedTypeName()

      Return the type name as actually specified for this particular value, if any.

    - #### setDynamic

          public void setDynamic()

      Mark this value as dynamic, i.e. as containing an expression and hence not being subject to caching.

    - #### isDynamic

          public boolean isDynamic()

      Return whether this value has been marked as dynamic.

    - #### equals

          public boolean equals(Object other)

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

    - #### hashCode

          public int hashCode()

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

    - #### toString

          public String toString()

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