站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

PropertyValue (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.beans
Class PropertyValue

java.lang.Object
  extended by org.springframework.core.AttributeAccessorSupport
      extended by org.springframework.beans.PropertyValue
All Implemented Interfaces:
Serializable, BeanMetadataElement, AttributeAccessor

public class PropertyValue
extends AttributeAccessorSupport
implements BeanMetadataElement, 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.

Since:
13 May 2001
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller
See Also:
PropertyValues, BeanWrapper, Serialized Form

Constructor Summary
PropertyValue(PropertyValue original)
          Copy constructor.
PropertyValue(String name, Object value)
          Create a new PropertyValue instance.
 
Method Summary
 boolean equals(Object other)
           
 Object getConvertedValue()
          Return the converted value of the constructor argument, after processed type conversion.
 String getName()
          Return the name of the property.
 Object getSource()
          Return the configuration source Object for this metadata element (may be null).
 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).
 void setConvertedValue(Object value)
          Set the converted value of the constructor argument, after processed type conversion.
 void setSource(Object source)
          Set the configuration source Object for this metadata element.
 String toString()
           
 
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, getAttribute, hasAttribute, removeAttribute, setAttribute
 
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 - the name of the property (never null)
value - the value of the property (possibly before type conversion)

PropertyValue

public PropertyValue(PropertyValue original)
Copy constructor.

Parameters:
original - the PropertyValue to copy (never null)
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.


setSource

public void setSource(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

public Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

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(Object value)
Set the converted value of the constructor argument, after processed type conversion.


getConvertedValue

public Object getConvertedValue()
Return the converted value of the constructor argument, after processed type conversion.


equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class AttributeAccessorSupport

toString

public String toString()
Overrides:
toString in class Object

The Spring Framework

Copyright © 2002-2007 The Spring Framework.