|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.AttributeAccessorSupport org.springframework.beans.BeanMetadataAttributeAccessor org.springframework.beans.PropertyValue
public class PropertyValue
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.
PropertyValues
,
BeanWrapper
,
Serialized FormField Summary | |
---|---|
(package private) java.lang.Boolean |
conversionNecessary
Package-visible field that indicates whether conversion is necessary |
private boolean |
converted
|
private java.lang.Object |
convertedValue
|
private java.lang.String |
name
|
private boolean |
optional
|
(package private) java.beans.PropertyDescriptor |
resolvedDescriptor
Package-visible field for caching the resolved PropertyDescriptor |
(package private) java.lang.Object |
resolvedTokens
Package-visible field for caching the resolved property path tokens |
private java.lang.Object |
source
|
private java.lang.Object |
value
|
Constructor Summary | |
---|---|
PropertyValue(PropertyValue original)
Copy constructor. |
|
PropertyValue(PropertyValue original,
java.lang.Object newValue)
Constructor that exposes a new value for an original value holder. |
|
PropertyValue(java.lang.String name,
java.lang.Object value)
Create a new PropertyValue instance. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
|
java.lang.Object |
getConvertedValue()
Return the converted value of the constructor argument, after processed type conversion. |
java.lang.String |
getName()
Return the name of the property. |
PropertyValue |
getOriginalPropertyValue()
Return the original PropertyValue instance for this value holder. |
java.lang.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()
|
void |
setConvertedValue(java.lang.Object value)
Set the converted value of the constructor argument, after processed type conversion. |
void |
setOptional(boolean optional)
|
java.lang.String |
toString()
|
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor |
---|
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource |
Methods inherited from class org.springframework.core.AttributeAccessorSupport |
---|
attributeNames, copyAttributesFrom, hasAttribute |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final java.lang.String name
private final java.lang.Object value
private java.lang.Object source
private boolean optional
private boolean converted
private java.lang.Object convertedValue
volatile java.lang.Boolean conversionNecessary
volatile java.lang.Object resolvedTokens
volatile java.beans.PropertyDescriptor resolvedDescriptor
Constructor Detail |
---|
public PropertyValue(java.lang.String name, java.lang.Object value)
name
- the name of the property (never null
)value
- the value of the property (possibly before type conversion)public PropertyValue(PropertyValue original)
original
- the PropertyValue to copy (never null
)public PropertyValue(PropertyValue original, java.lang.Object newValue)
original
- the PropertyValue to link to (never null
)newValue
- the new value to applyMethod Detail |
---|
public java.lang.String getName()
public java.lang.Object getValue()
Note that type conversion will not have occurred here. It is the responsibility of the BeanWrapper implementation to perform type conversion.
public PropertyValue getOriginalPropertyValue()
public void setOptional(boolean optional)
public boolean isOptional()
public boolean isConverted()
true
),
or whether the value still needs to be converted (false
).
public void setConvertedValue(java.lang.Object value)
public java.lang.Object getConvertedValue()
public boolean equals(java.lang.Object other)
equals
in class AttributeAccessorSupport
public int hashCode()
hashCode
in class AttributeAccessorSupport
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |