| java.lang.Object org.springframework.beans.PropertyEditorRegistrySupport org.springframework.beans.AbstractPropertyAccessor org.springframework.beans.BeanWrapperImpl
Constructor Summary | |
public | BeanWrapperImpl() Create new empty BeanWrapperImpl. | public | BeanWrapperImpl(boolean registerDefaultEditors) Create new empty BeanWrapperImpl. | public | BeanWrapperImpl(Object object) Create new BeanWrapperImpl for the given object. | public | BeanWrapperImpl(Class clazz) Create new BeanWrapperImpl, wrapping a new instance of the specified class. | public | BeanWrapperImpl(Object object, String nestedPath, Object rootObject) Create new BeanWrapperImpl for the given object,
registering a nested path that the object is in. |
Method Summary | |
public Object | convertForProperty(Object value, String propertyName) Convert the given value for the specified property to the latter's type. | public Object | convertIfNecessary(Object value, Class requiredType) | public Object | convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam) | public Object | doTypeConversionIfNecessary(Object value, Class requiredType) | protected BeanWrapperImpl | getBeanWrapperForPropertyPath(String propertyPath) Recursively navigate to return a BeanWrapper for the nested property path. | final public String | getNestedPath() Return the nested path of the object wrapped by this BeanWrapper. | public PropertyDescriptor | getPropertyDescriptor(String propertyName) | protected PropertyDescriptor | getPropertyDescriptorInternal(String propertyName) Internal version of
BeanWrapperImpl.getPropertyDescriptor :
Returns null if not found rather than throwing an exception. | public PropertyDescriptor[] | getPropertyDescriptors() | public Class | getPropertyType(String propertyName) | public Object | getPropertyValue(String propertyName) | final public Class | getRootClass() Return the class of the root object at the top of the path of this BeanWrapper. | final public Object | getRootInstance() Return the root object at the top of the path of this BeanWrapper. | final public Class | getWrappedClass() | final public Object | getWrappedInstance() | public boolean | isReadableProperty(String propertyName) | public boolean | isWritableProperty(String propertyName) | protected BeanWrapperImpl | newNestedBeanWrapper(Object object, String nestedPath) Create a new nested BeanWrapper instance. | protected void | setIntrospectionClass(Class clazz) Set the class to introspect. | public void | setPropertyValue(String propertyName, Object value) | public void | setPropertyValue(PropertyValue pv) | public void | setWrappedInstance(Object object) Switch the target object, replacing the cached introspection results only
if the class of the new object is different to that of the replaced object. | public void | setWrappedInstance(Object object, String nestedPath, Object rootObject) Switch the target object, replacing the cached introspection results only
if the class of the new object is different to that of the replaced object. | public String | toString() |
BeanWrapperImpl | public BeanWrapperImpl(boolean registerDefaultEditors)(Code) | | Create new empty BeanWrapperImpl. Wrapped instance needs to be set afterwards.
Parameters: registerDefaultEditors - whether to register default editors(can be suppressed if the BeanWrapper won't need any type conversion) See Also: BeanWrapperImpl.setWrappedInstance |
BeanWrapperImpl | public BeanWrapperImpl(Object object)(Code) | | Create new BeanWrapperImpl for the given object.
Parameters: object - object wrapped by this BeanWrapper |
BeanWrapperImpl | public BeanWrapperImpl(Class clazz)(Code) | | Create new BeanWrapperImpl, wrapping a new instance of the specified class.
Parameters: clazz - class to instantiate and wrap |
BeanWrapperImpl | public BeanWrapperImpl(Object object, String nestedPath, Object rootObject)(Code) | | Create new BeanWrapperImpl for the given object,
registering a nested path that the object is in.
Parameters: object - object wrapped by this BeanWrapper Parameters: nestedPath - the nested path of the object Parameters: rootObject - the root object at the top of the path |
convertForProperty | public Object convertForProperty(Object value, String propertyName) throws TypeMismatchException(Code) | | Convert the given value for the specified property to the latter's type.
This method is only intended for optimizations in a BeanFactory.
Use the convertIfNecessary methods for programmatic conversion.
Parameters: value - the value to convert Parameters: propertyName - the target property(note that nested or indexed properties are not supported here) the new value, possibly the result of type conversion throws: TypeMismatchException - if type conversion failed |
getBeanWrapperForPropertyPath | protected BeanWrapperImpl getBeanWrapperForPropertyPath(String propertyPath)(Code) | | Recursively navigate to return a BeanWrapper for the nested property path.
Parameters: propertyPath - property property path, which may be nested a BeanWrapper for the target bean |
getNestedPath | final public String getNestedPath()(Code) | | Return the nested path of the object wrapped by this BeanWrapper.
|
getWrappedClass | final public Class getWrappedClass()(Code) | | |
getWrappedInstance | final public Object getWrappedInstance()(Code) | | |
isReadableProperty | public boolean isReadableProperty(String propertyName)(Code) | | |
isWritableProperty | public boolean isWritableProperty(String propertyName)(Code) | | |
newNestedBeanWrapper | protected BeanWrapperImpl newNestedBeanWrapper(Object object, String nestedPath)(Code) | | Create a new nested BeanWrapper instance.
Default implementation creates a BeanWrapperImpl instance.
Can be overridden in subclasses to create a BeanWrapperImpl subclass.
Parameters: object - object wrapped by this BeanWrapper Parameters: nestedPath - the nested path of the object the nested BeanWrapper instance |
setIntrospectionClass | protected void setIntrospectionClass(Class clazz)(Code) | | Set the class to introspect.
Needs to be called when the target object changes.
Parameters: clazz - the class to introspect |
setWrappedInstance | public void setWrappedInstance(Object object)(Code) | | Switch the target object, replacing the cached introspection results only
if the class of the new object is different to that of the replaced object.
Parameters: object - the new target object |
setWrappedInstance | public void setWrappedInstance(Object object, String nestedPath, Object rootObject)(Code) | | Switch the target object, replacing the cached introspection results only
if the class of the new object is different to that of the replaced object.
Parameters: object - the new target object Parameters: nestedPath - the nested path of the object Parameters: rootObject - the root object at the top of the path |
|
|