| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The central interface of Spring's low-level JavaBeans infrastructure. Typically not directly used by application code but rather implicitly via a BeanFactory or a DataBinder.
To be implemented by classes that can manipulate Java beans. Implementing classes have the ability to get and set property values (individually or in bulk), get property descriptors and query the readability and writability of properties.
This interface supports nested properties enabling the setting of properties on subproperties to an unlimited depth.
If a property update causes an exception, a PropertyVetoException will be thrown. Bulk updates continue after exceptions are encountered, throwing an exception wrapping all exceptions encountered during the update.
BeanWrapper implementations can be used repeatedly, with their "target" or wrapped object changed.
| Field Summary | |
final static String | NESTED_PROPERTY_SEPARATORPath separator for nested properties. |
| Method Summary | |
PropertyEditor | findCustomEditor(Class requiredType, String propertyPath)Find a custom property editor for the given type and property. |
PropertyDescriptor | getPropertyDescriptor(String propertyName)Get the property descriptor for a particular property. |
PropertyDescriptor[] | getPropertyDescriptors()Get the PropertyDescriptors identified on this object (standard JavaBeans introspection). |
Object | getPropertyValue(String propertyName)Get the value of a property. |
Class | getWrappedClass()Convenience method to return the class of the wrapped object. |
Object | getWrappedInstance()Return the bean wrapped by this object (cannot be null). |
Object | invoke(String methodName, Object[] args)Invoke the named method. |
boolean | isReadableProperty(String propertyName)Return whether this property is readable. |
boolean | isWritableProperty(String propertyName)Return whether this property is writable. |
void | registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)Register the given custom property editor for all properties of the given type. |
void | registerCustomEditor(Class requiredType, String propertyPath, PropertyEditor propertyEditor)Register the given custom property editor for the given type and property, or for all properties of the given type. |
void | setPropertyValue(String propertyName, Object value)Set a property value. |
void | setPropertyValue(PropertyValue pv)Update 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. |
void | setWrappedInstance(Object obj)Change the wrapped object. |
| Field Detail |
public final static String NESTED_PROPERTY_SEPARATOR
| Method Detail |
public PropertyEditor findCustomEditor(Class requiredType, String propertyPath)
public PropertyDescriptor getPropertyDescriptor(String propertyName)
throws BeansException
public PropertyDescriptor[] getPropertyDescriptors()
throws BeansException
public Object getPropertyValue(String propertyName)
throws BeansException
public Class getWrappedClass()
public Object getWrappedInstance()
public Object invoke(String methodName, Object[] args)
throws BeansException
public boolean isReadableProperty(String propertyName)
public boolean isWritableProperty(String propertyName)
public void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)
public void registerCustomEditor(Class requiredType, String propertyPath, PropertyEditor propertyEditor)
public void setPropertyValue(String propertyName, Object value)
throws BeansException
public void setPropertyValue(PropertyValue pv)
throws BeansException
public 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.
public 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 vetoed property change or a type mismatch, but not an invalid fieldname 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, null).
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown)
throws BeansException
Does not allow unknown fields.
public void setWrappedInstance(Object obj)
throws BeansException
| Association Links |
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||