org.springframework.beans

## 类 PropertyValue

- java.lang.Object
- - org.springframework.core.AttributeAccessorSupport
  - - org.springframework.beans.BeanMetadataAttributeAccessor
    - - org.springframework.beans.PropertyValue

- 所有已实现的接口:
    Serializable, BeanMetadataElement, org.springframework.core.AttributeAccessor

      public class PropertyValue
      extends BeanMetadataAttributeAccessor
      implements Serializable

  Object to hold information and value for an individual bean property. Using an object here, rather than just storing all properties in a map keyed by property name, allows for more flexibility, and the ability to handle indexed properties etc in an optimized way.

  Note that the value doesn't need to be the final required type: A `BeanWrapper` implementation should handle any necessary conversion, as this object doesn't know anything about the objects it will be applied to.

  从以下版本开始:
    13 May 2001
  作者:
    Rod Johnson, Rob Harrop, Juergen Hoeller
  另请参阅:
    `PropertyValues`, `BeanWrapper`, 序列化表格

- - ### 构造器概要

    构造器
    构造器和说明
    `PropertyValue(PropertyValue original)` Copy constructor.
    `PropertyValue(PropertyValue original, Object newValue)` Constructor that exposes a new value for an original value holder.
    `PropertyValue(String name, Object value)` Create a new PropertyValue instance.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `equals(Object other)`
    `Object` | `getConvertedValue()` Return the converted value of this property value, after processed type conversion.
    `String` | `getName()` Return the name of the property.
    `PropertyValue` | `getOriginalPropertyValue()` Return the original PropertyValue instance for this value holder.
    `Object` | `getValue()` Return the value of the property.
    `int` | `hashCode()`
    `boolean` | `isConverted()` Return whether this holder contains a converted value already (`true`), or whether the value still needs to be converted (`false`).
    `boolean` | `isOptional()` Return whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.
    `void` | `setConvertedValue(Object value)` Set the converted value of this property value, after processed type conversion.
    `void` | `setOptional(boolean optional)` Set whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.
    `String` | `toString()`

    - ### 从类继承的方法 org.springframework.beans.BeanMetadataAttributeAccessor

      `addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource`

    - ### 从类继承的方法 org.springframework.core.AttributeAccessorSupport

      `attributeNames, copyAttributesFrom, hasAttribute`

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

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

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

    - #### PropertyValue

          public PropertyValue(String name,
                               @Nullable
                               Object value)

      Create a new PropertyValue instance.
      参数:
        `name` - the name of the property (never `null`)
        `value` - the value of the property (possibly before type conversion)

    - #### PropertyValue

          public PropertyValue(PropertyValue original)

      Copy constructor.
      参数:
        `original` - the PropertyValue to copy (never `null`)

    - #### PropertyValue

          public PropertyValue(PropertyValue original,
                               @Nullable
                               Object newValue)

      Constructor that exposes a new value for an original value holder. The original holder will be exposed as source of the new holder.
      参数:
        `original` - the PropertyValue to link to (never `null`)
        `newValue` - the new value to apply

  - ### 方法详细资料

    - #### getName

          public String getName()

      Return the name of the property.

    - #### getValue

          @Nullable
          public Object getValue()

      Return the value of the property.

      Note that type conversion will not have occurred here. It is the responsibility of the BeanWrapper implementation to perform type conversion.

    - #### getOriginalPropertyValue

          public PropertyValue getOriginalPropertyValue()

      Return the original PropertyValue instance for this value holder.
      返回:
        the original PropertyValue (either a source of this value holder or this value holder itself).

    - #### setOptional

          public void setOptional(boolean optional)

      Set whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.
      从以下版本开始:
        3.0

    - #### isOptional

          public boolean isOptional()

      Return whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.
      从以下版本开始:
        3.0

    - #### isConverted

          public boolean isConverted()

      Return whether this holder contains a converted value already (`true`), or whether the value still needs to be converted (`false`).

    - #### setConvertedValue

          public void setConvertedValue(@Nullable
                                        Object value)

      Set the converted value of this property value, after processed type conversion.

    - #### getConvertedValue

          @Nullable
          public Object getConvertedValue()

      Return the converted value of this property value, after processed type conversion.

    - #### equals

          public boolean equals(Object other)

      覆盖:
        `equals` 在类中 `org.springframework.core.AttributeAccessorSupport`

    - #### hashCode

          public int hashCode()

      覆盖:
        `hashCode` 在类中 `org.springframework.core.AttributeAccessorSupport`

    - #### toString

          public String toString()

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