org.springframework.beans
Class PropertyValue

java.lang.Object
  extended by org.springframework.beans.PropertyValue
All Implemented Interfaces:
Serializable

public class PropertyValue
extends Object
implements Serializable

Class to hold information and value for an individual 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 a special way if necessary.

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.

Since:
13 May 2001
Author:
Rod Johnson
See Also:
PropertyValues, BeanWrapper, Serialized Form

Constructor Summary
PropertyValue(String name, Object value)
          Create a new PropertyValue instance.
 
Method Summary
 boolean equals(Object other)
           
 String getName()
          Return the name of the property.
 Object getValue()
          Return the value of the property.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyValue

public PropertyValue(String name,
                     Object value)
Create a new PropertyValue instance.

Parameters:
name - name of the property
value - value of the property (possibly before type conversion)
Method Detail

getName

public String getName()
Return the name of the property.


getValue

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.


equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2002-2007 The Spring Framework Project.