spring-framework / org.springframework.beans / PropertyValue

PropertyValue

open class PropertyValue : BeanMetadataAttributeAccessor, 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.

Author
Rod Johnson

Author
Rob Harrop

Author
Juergen Hoeller

Since
13 May 2001

See Also
PropertyValuesBeanWrapper

Constructors

<init>

PropertyValue(name: String, value: Any)

Create a new PropertyValue instance.

PropertyValue(original: PropertyValue)

Copy constructor.

PropertyValue(original: PropertyValue, newValue: Any)

Constructor that exposes a new value for an original value holder. The original holder will be exposed as source of the new holder.

Functions

equals

open fun equals(other: Any?): Boolean

getConvertedValue

open fun getConvertedValue(): Any

Return the converted value of the constructor argument, after processed type conversion.

getName

open fun getName(): String

Return the name of the property.

getOriginalPropertyValue

open fun getOriginalPropertyValue(): PropertyValue

Return the original PropertyValue instance for this value holder.

getValue

open fun getValue(): Any

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.

hashCode

open fun hashCode(): Int

isConverted

open fun isConverted(): Boolean

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

isOptional

open fun isOptional(): Boolean

Return whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.

setConvertedValue

open fun setConvertedValue(value: Any): Unit

Set the converted value of the constructor argument, after processed type conversion.

setOptional

open fun setOptional(optional: Boolean): Unit

Set whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.

toString

open fun toString(): String