|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PropertyAccessor
Common interface for classes that can access bean properties. Serves as base interface for BeanWrapper.
BeanWrapper
Field Summary | |
---|---|
static String |
NESTED_PROPERTY_SEPARATOR
Path separator for nested properties. |
static char |
NESTED_PROPERTY_SEPARATOR_CHAR
|
static String |
PROPERTY_KEY_PREFIX
Marker that indicates the start of a property key for an indexed or mapped property like "person.addresses[0]". |
static char |
PROPERTY_KEY_PREFIX_CHAR
|
static String |
PROPERTY_KEY_SUFFIX
Marker that indicates the end of a property key for an indexed or mapped property like "person.addresses[0]". |
static char |
PROPERTY_KEY_SUFFIX_CHAR
|
Method Summary | |
---|---|
Object |
getPropertyValue(String propertyName)
Get the value of a property. |
void |
setPropertyValue(PropertyValue pv)
Update a property value. |
void |
setPropertyValue(String propertyName,
Object value)
Set a property value. |
void |
setPropertyValues(Map map)
Perform a bulk update from a Map. |
void |
setPropertyValues(PropertyValues pvs)
The preferred way to perform a bulk update. |
void |
setPropertyValues(PropertyValues pvs,
boolean ignoreUnknown)
Perform a bulk update with full control over behavior. |
Field Detail |
---|
static final String NESTED_PROPERTY_SEPARATOR
static final char NESTED_PROPERTY_SEPARATOR_CHAR
static final String PROPERTY_KEY_PREFIX
static final char PROPERTY_KEY_PREFIX_CHAR
static final String PROPERTY_KEY_SUFFIX
static final char PROPERTY_KEY_SUFFIX_CHAR
Method Detail |
---|
Object getPropertyValue(String propertyName) throws BeansException
propertyName
- name of the property to get the value of
FatalBeanException
- if there is no such property, if the property
isn't readable, or if the property getter throws an exception.
BeansException
void setPropertyValue(String propertyName, Object value) throws BeansException
propertyName
- name of the property to set value ofvalue
- the new value
FatalBeanException
- if there is no such property, if the property
isn't writable, or if the property setter throws an exception.
BeansException
void setPropertyValue(PropertyValue pv) throws BeansException
pv
- object containing new property value
FatalBeanException
- if there is no such property, if the property
isn't writable, or if the property setter throws an exception.
BeansException
void setPropertyValues(Map map) throws BeansException
Bulk updates from PropertyValues are more powerful: This method is provided for convenience. Behaviour will be identical to that of the setPropertyValues(PropertyValues) method.
map
- Map to take properties from. Contains property value objects,
keyed by property name
FatalBeanException
- if there is no such property, if the property
isn't writable, or if the property setter throws an exception.
BeansException
void setPropertyValues(PropertyValues pvs) throws BeansException
Note that performing a bulk update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyAccessExceptionsException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated stay changed.
Does not allow unknown fields. Equivalent to setPropertyValues(pvs, false).
pvs
- PropertyValues to set on the target object
FatalBeanException
- if there is no such property, if the property
isn't writable, or if the property setter throws an exception.
BeansException
setPropertyValues(PropertyValues, boolean)
void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) throws BeansException
Note that performing a bulk update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyAccessExceptionsException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated stay changed.
Does not allow unknown fields.
pvs
- PropertyValues to set on the target objectignoreUnknown
- should we ignore unknown values (not found in the bean)
FatalBeanException
- if there is no such property, if the property
isn't writable, or if the property setter throws an exception.
BeansException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |