|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanWrapper
The central interface of Spring's low-level JavaBeans infrastructure. Extends the PropertyAccessor and PropertyEditorRegistry interfaces.
The default implementation is BeanWrapperImpl. Typically not used directly but rather implicitly via a BeanFactory or a DataBinder.
Provides operations to analyze and manipulate standard Java Beans: the ability to get and set property values (individually or in bulk), get property descriptors, query the readability/writability of properties.
This interface supports nested properties enabling the setting of properties on subproperties to an unlimited depth.
A BeanWrapper instance can be used repeatedly, with its target object (the wrapped Java Bean instance) changing.
PropertyAccessor
,
PropertyEditorRegistry
,
BeanWrapperImpl
,
BeanFactory
,
DataBinder
Field Summary |
---|
Fields inherited from interface org.springframework.beans.PropertyAccessor |
---|
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR |
Method Summary | |
---|---|
PropertyDescriptor |
getPropertyDescriptor(String propertyName)
Get the property descriptor for a particular property. |
PropertyDescriptor[] |
getPropertyDescriptors()
Get the PropertyDescriptors identified on this object (standard JavaBeans introspection). |
Class |
getPropertyType(String propertyName)
Determine the property type for a particular property, either checking the property descriptor or checking the value in case of an indexed or mapped element. |
Class |
getWrappedClass()
Convenience method to return the class of the wrapped object. |
Object |
getWrappedInstance()
Return the bean wrapped by this object (cannot be null ). |
boolean |
isExtractOldValueForEditor()
Return whether to extract the old property value when applying a property editor to a new value for a property. |
boolean |
isReadableProperty(String propertyName)
Return whether this property is readable. |
boolean |
isWritableProperty(String propertyName)
Return whether this property is writable. |
void |
setExtractOldValueForEditor(boolean extractOldValueForEditor)
Set whether to extract the old property value when applying a property editor to a new value for a property. |
void |
setWrappedInstance(Object obj)
Change the wrapped object. |
Methods inherited from interface org.springframework.beans.PropertyAccessor |
---|
getPropertyValue, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues |
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry |
---|
findCustomEditor, registerCustomEditor, registerCustomEditor |
Method Detail |
---|
void setWrappedInstance(Object obj)
obj
- wrapped object that we are manipulatingObject getWrappedInstance()
null
).
Class getWrappedClass()
void setExtractOldValueForEditor(boolean extractOldValueForEditor)
Default is "false", avoiding side effects caused by getters. Turn this to "true" to expose previous property values to custom editors.
boolean isExtractOldValueForEditor()
PropertyDescriptor[] getPropertyDescriptors() throws BeansException
BeansException
PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException
propertyName
- property to check status for
InvalidPropertyException
- if there is no such property
BeansException
boolean isReadableProperty(String propertyName) throws BeansException
propertyName
- property to check status for
BeansException
boolean isWritableProperty(String propertyName) throws BeansException
propertyName
- property to check status for
BeansException
Class getPropertyType(String propertyName) throws BeansException
propertyName
- property to check status for
null
if not determinable (can only happen with an indexed or mapped element)
InvalidPropertyException
- if there is no such property
BeansException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |