public class DirectFieldAccessor
extends org.springframework.beans.AbstractPropertyAccessor
PropertyAccessor implementation that directly accesses instance fields.
Allows for direct binding to fields instead of going through JavaBean setters.
This implementation just supports fields in the actual target object. It is not able to traverse nested fields.
A DirectFieldAccessor's default for the "extractOldValueForEditor" setting is "true", since a field can always be read without side effects. Note: This class was copied from spring framework for use in AbstractView until SPR-8389 become fixed and released. Don't use it, it will be deleted soon
AbstractPropertyAccessor.setExtractOldValueForEditor(boolean),
BeanWrapper,
DirectFieldBindingResult,
DataBinder.initDirectFieldAccess()| Constructor and Description |
|---|
DirectFieldAccessor(Object target)
Create a new DirectFieldAccessor for the given target object.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
convertIfNecessary(Object value,
Class<T> requiredType,
org.springframework.core.MethodParameter methodParam) |
Class<?> |
getPropertyType(String propertyName) |
org.springframework.core.convert.TypeDescriptor |
getPropertyTypeDescriptor(String propertyName) |
Object |
getPropertyValue(String propertyName) |
boolean |
isReadableProperty(String propertyName) |
boolean |
isWritableProperty(String propertyName) |
void |
setPropertyValue(String propertyName,
Object newValue) |
isExtractOldValueForEditor, setExtractOldValueForEditor, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValuesconvertIfNecessary, convertIfNecessarycopyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, overrideDefaultEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, setConversionService, useConfigValueEditorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConversionService, setConversionServicepublic DirectFieldAccessor(Object target)
target - the target object to accesspublic boolean isReadableProperty(String propertyName) throws org.springframework.beans.BeansException
org.springframework.beans.BeansExceptionpublic boolean isWritableProperty(String propertyName) throws org.springframework.beans.BeansException
org.springframework.beans.BeansExceptionpublic Class<?> getPropertyType(String propertyName) throws org.springframework.beans.BeansException
getPropertyType in interface org.springframework.beans.PropertyAccessorgetPropertyType in class org.springframework.beans.AbstractPropertyAccessororg.springframework.beans.BeansExceptionpublic org.springframework.core.convert.TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws org.springframework.beans.BeansException
org.springframework.beans.BeansExceptionpublic Object getPropertyValue(String propertyName) throws org.springframework.beans.BeansException
getPropertyValue in interface org.springframework.beans.PropertyAccessorgetPropertyValue in class org.springframework.beans.AbstractPropertyAccessororg.springframework.beans.BeansExceptionpublic void setPropertyValue(String propertyName, Object newValue) throws org.springframework.beans.BeansException
setPropertyValue in interface org.springframework.beans.PropertyAccessorsetPropertyValue in class org.springframework.beans.AbstractPropertyAccessororg.springframework.beans.BeansExceptionpublic <T> T convertIfNecessary(Object value, Class<T> requiredType, org.springframework.core.MethodParameter methodParam) throws org.springframework.beans.TypeMismatchException
convertIfNecessary in interface org.springframework.beans.TypeConverterconvertIfNecessary in class org.springframework.beans.TypeConverterSupportorg.springframework.beans.TypeMismatchExceptionCopyright © 2014 JDAL. All Rights Reserved.