Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » beans » [javadoc | source]
org.springframework.beans
public interface: BeanWrapper [javadoc | source]

All Implemented Interfaces:
    ConfigurablePropertyAccessor

All Known Implementing Classes:
    BeanWrapperImpl

The central interface of Spring's low-level JavaBeans infrastructure.

Typically not used directly but rather implicitly via a org.springframework.beans.factory.BeanFactory or a org.springframework.validation.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 instance can be used repeatedly, with its target object (the wrapped JavaBean instance) changing as required.

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.

Method from org.springframework.beans.BeanWrapper Summary:
getPropertyDescriptor,   getPropertyDescriptors,   getWrappedClass,   getWrappedInstance,   setWrappedInstance
Method from org.springframework.beans.BeanWrapper Detail:
 public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException
    Obtain the property descriptor for a specific property of the wrapped object.
 public PropertyDescriptor[] getPropertyDescriptors()
    Obtain the PropertyDescriptors for the wrapped object (as determined by standard JavaBeans introspection).
 public Class getWrappedClass()
    Return the type of the wrapped JavaBean object.
 public Object getWrappedInstance()
    Return the bean instance wrapped by this object, if any.
 public  void setWrappedInstance(Object obj)Deprecated! as -  of Spring 2.5,
in favor of recreating a BeanWrapper per target instance

    Change the wrapped JavaBean object.