Interface BeanWrapper

All Superinterfaces:
ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter
All Known Implementing Classes:

public interface BeanWrapper extends ConfigurablePropertyAccessor
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.

13 April 2001
Rod Johnson, Juergen Hoeller
See Also:
  • Method Details

    • setAutoGrowCollectionLimit

      void setAutoGrowCollectionLimit(int autoGrowCollectionLimit)
      Specify a limit for array and collection auto-growing.

      Default is unlimited on a plain BeanWrapper.

    • getAutoGrowCollectionLimit

      int getAutoGrowCollectionLimit()
      Return the limit for array and collection auto-growing.
    • getWrappedInstance

      Object getWrappedInstance()
      Return the bean instance wrapped by this object.
    • getWrappedClass

      Class<?> getWrappedClass()
      Return the type of the wrapped bean instance.
    • getPropertyDescriptors

      PropertyDescriptor[] getPropertyDescriptors()
      Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).
      the PropertyDescriptors for the wrapped object
    • getPropertyDescriptor

      PropertyDescriptor getPropertyDescriptor(String propertyName) throws InvalidPropertyException
      Obtain the property descriptor for a specific property of the wrapped object.
      propertyName - the property to obtain the descriptor for (may be a nested path, but not an indexed/mapped property)
      the property descriptor for the specified property
      InvalidPropertyException - if there is no such property