public interface BeanWrapper extends ConfigurablePropertyAccessor
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()
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
Modifier and Type | Method and Description |
---|---|
int |
getAutoGrowCollectionLimit()
Return the limit for array and collection auto-growing.
|
java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.String propertyName)
Obtain the property descriptor for a specific property
of the wrapped object.
|
java.beans.PropertyDescriptor[] |
getPropertyDescriptors()
Obtain the PropertyDescriptors for the wrapped object
(as determined by standard JavaBeans introspection).
|
java.lang.Class<?> |
getWrappedClass()
Return the type of the wrapped bean instance.
|
java.lang.Object |
getWrappedInstance()
Return the bean instance wrapped by this object.
|
void |
setAutoGrowCollectionLimit(int autoGrowCollectionLimit)
Specify a limit for array and collection auto-growing.
|
getConversionService, isAutoGrowNestedPaths, isExtractOldValueForEditor, setAutoGrowNestedPaths, setConversionService, setExtractOldValueForEditor
getPropertyType, getPropertyTypeDescriptor, getPropertyValue, isReadableProperty, isWritableProperty, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
findCustomEditor, registerCustomEditor, registerCustomEditor
convertIfNecessary, convertIfNecessary, convertIfNecessary
void setAutoGrowCollectionLimit(int autoGrowCollectionLimit)
Default is unlimited on a plain BeanWrapper.
int getAutoGrowCollectionLimit()
java.lang.Object getWrappedInstance()
java.lang.Class<?> getWrappedClass()
java.beans.PropertyDescriptor[] getPropertyDescriptors()
java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.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 property