|
|||||||||
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.
Typically not used directly but rather implicitly via a
BeanFactory
or a
DataBinder
.
Provides operations to analyze and manipulate standard JavaBeans: the ability to get and set property values (individually or in bulk), get property descriptors, and query the readability/writability of properties.
This interface supports nested properties enabling the setting of properties on subproperties to an unlimited depth.
A BeanWrapper's default for the "extractOldValueForEditor" setting is "false", to avoid side effects caused by getter method invocations. Turn this to "true" to expose present property values to custom editors.
PropertyAccessor
,
PropertyEditorRegistry
,
PropertyAccessorFactory.forBeanPropertyAccess(java.lang.Object)
,
BeanFactory
,
BeanPropertyBindingResult
,
DataBinder.initBeanPropertyAccess()
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)
Obtain the property descriptor for a specific property of the wrapped object. |
PropertyDescriptor[] |
getPropertyDescriptors()
Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection). |
Class |
getWrappedClass()
Return the type of the wrapped JavaBean object. |
Object |
getWrappedInstance()
Return the bean instance wrapped by this object, if any. |
boolean |
isAutoGrowNestedPaths()
Return whether "auto-growing" of nested paths has been activated. |
void |
setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value. |
Methods inherited from interface org.springframework.beans.ConfigurablePropertyAccessor |
---|
getConversionService, isExtractOldValueForEditor, setConversionService, setExtractOldValueForEditor |
Methods inherited from interface org.springframework.beans.PropertyAccessor |
---|
getPropertyType, getPropertyTypeDescriptor, getPropertyValue, isReadableProperty, isWritableProperty, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues |
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry |
---|
findCustomEditor, registerCustomEditor, registerCustomEditor |
Methods inherited from interface org.springframework.beans.TypeConverter |
---|
convertIfNecessary, convertIfNecessary |
Method Detail |
---|
Object getWrappedInstance()
null
if none setClass getWrappedClass()
null
if no wrapped object has been setPropertyDescriptor[] getPropertyDescriptors()
PropertyDescriptor getPropertyDescriptor(String propertyName) throws InvalidPropertyException
propertyName
- the property to obtain the descriptor for
(may be a nested path, but no indexed/mapped property)
InvalidPropertyException
- if there is no such propertyvoid setAutoGrowNestedPaths(boolean autoGrowNestedPaths)
If "true", a null path location will be populated with a default object value and traversed
instead of resulting in a NullValueInNestedPathException
. Turning this flag on also
enables auto-growth of collection elements when accessing an out-of-bounds index.
Default is "false" on a plain BeanWrapper.
boolean isAutoGrowNestedPaths()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |