public class

PropertyValue

extends BeanMetadataAttributeAccessor
implements Serializable
java.lang.Object
   ↳ org.springframework.core.AttributeAccessorSupport
     ↳ org.springframework.beans.BeanMetadataAttributeAccessor
       ↳ org.springframework.beans.PropertyValue

Class Overview

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.

Summary

Public Constructors
PropertyValue(String name, Object value)
Create a new PropertyValue instance.
PropertyValue(PropertyValue original)
Copy constructor.
PropertyValue(PropertyValue original, Object newValue)
Constructor that exposes a new value for an original value holder.
Public Methods
boolean equals(Object other)
synchronized Object getConvertedValue()
Return the converted value of the constructor argument, 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()
synchronized boolean isConverted()
Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).
boolean isOptional()
synchronized void setConvertedValue(Object value)
Set the converted value of the constructor argument, after processed type conversion.
void setOptional(boolean optional)
String toString()
[Expand]
Inherited Methods
From class org.springframework.beans.BeanMetadataAttributeAccessor
From class org.springframework.core.AttributeAccessorSupport
From class java.lang.Object
From interface org.springframework.beans.BeanMetadataElement
From interface org.springframework.core.AttributeAccessor

Public Constructors

public PropertyValue (String name, Object value)

Also: SpringBeans

Create a new PropertyValue instance.

Parameters
name the name of the property (never null)
value the value of the property (possibly before type conversion)

public PropertyValue (PropertyValue original)

Also: SpringBeans

Copy constructor.

Parameters
original the PropertyValue to copy (never null)

public PropertyValue (PropertyValue original, Object newValue)

Also: SpringBeans

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

Parameters
original the PropertyValue to link to (never null)
newValue the new value to apply

Public Methods

public boolean equals (Object other)

Also: SpringBeans

public synchronized Object getConvertedValue ()

Also: SpringBeans

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

public String getName ()

Also: SpringBeans

Return the name of the property.

public PropertyValue getOriginalPropertyValue ()

Also: SpringBeans

Return the original PropertyValue instance for this value holder.

Returns
  • the original PropertyValue (either a source of this value holder or this value holder itself).

public Object getValue ()

Also: SpringBeans

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.

public int hashCode ()

Also: SpringBeans

public synchronized boolean isConverted ()

Also: SpringBeans

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

public boolean isOptional ()

Also: SpringBeans

public synchronized void setConvertedValue (Object value)

Also: SpringBeans

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

public void setOptional (boolean optional)

Also: SpringBeans

public String toString ()

Also: SpringBeans