public class DirectFieldAccessor extends AbstractNestablePropertyAccessor
ConfigurablePropertyAccessor implementation that directly accesses
instance fields. Allows for direct binding to fields instead of going through
JavaBean setters.
As of Spring 4.2, the vast majority of the BeanWrapper features have
been merged to AbstractPropertyAccessor, which means that property
traversal as well as collections and map access is now supported here as well.
A DirectFieldAccessor's default for the "extractOldValueForEditor" setting is "true", since a field can always be read without side effects.
AbstractPropertyAccessor.setExtractOldValueForEditor(boolean),
BeanWrapper,
org.springframework.validation.DirectFieldBindingResult,
org.springframework.validation.DataBinder#initDirectFieldAccess()AbstractNestablePropertyAccessor.PropertyHandler, AbstractNestablePropertyAccessor.PropertyTokenHolderNESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR| Modifier | Constructor and Description |
|---|---|
|
DirectFieldAccessor(java.lang.Object object)
Create a new DirectFieldAccessor for the given object.
|
protected |
DirectFieldAccessor(java.lang.Object object,
java.lang.String nestedPath,
DirectFieldAccessor parent)
Create a new DirectFieldAccessor for the given object,
registering a nested path that the object is in.
|
| Modifier and Type | Method and Description |
|---|---|
protected NotWritablePropertyException |
createNotWritablePropertyException(java.lang.String propertyName)
Create a
NotWritablePropertyException for the specified property. |
protected org.springframework.beans.DirectFieldAccessor.FieldPropertyHandler |
getLocalPropertyHandler(java.lang.String propertyName)
Return a
AbstractNestablePropertyAccessor.PropertyHandler for the specified local propertyName. |
protected DirectFieldAccessor |
newNestedPropertyAccessor(java.lang.Object object,
java.lang.String nestedPath)
Create a new nested property accessor instance.
|
convertForProperty, getAutoGrowCollectionLimit, getFinalPath, getNestedPath, getPropertyAccessorForPropertyPath, getPropertyHandler, getPropertyType, getPropertyTypeDescriptor, getPropertyValue, getPropertyValue, getRootClass, getRootInstance, getWrappedClass, getWrappedInstance, isReadableProperty, isWritableProperty, setAutoGrowCollectionLimit, setPropertyValue, setPropertyValue, setPropertyValue, setWrappedInstance, setWrappedInstance, toStringisAutoGrowNestedPaths, isExtractOldValueForEditor, setAutoGrowNestedPaths, setExtractOldValueForEditor, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValuesconvertIfNecessary, convertIfNecessary, convertIfNecessarycopyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, overrideDefaultEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, setConversionService, useConfigValueEditorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetConversionService, setConversionServicefindCustomEditor, registerCustomEditor, registerCustomEditorconvertIfNecessary, convertIfNecessary, convertIfNecessarypublic DirectFieldAccessor(java.lang.Object object)
object - object wrapped by this DirectFieldAccessorprotected DirectFieldAccessor(java.lang.Object object,
java.lang.String nestedPath,
DirectFieldAccessor parent)
object - object wrapped by this DirectFieldAccessornestedPath - the nested path of the objectparent - the containing DirectFieldAccessor (must not be null)protected org.springframework.beans.DirectFieldAccessor.FieldPropertyHandler getLocalPropertyHandler(java.lang.String propertyName)
AbstractNestablePropertyAccessorAbstractNestablePropertyAccessor.PropertyHandler for the specified local propertyName. Only
used to reach a property available in the current context.getLocalPropertyHandler in class AbstractNestablePropertyAccessorpropertyName - the name of a local propertynull if it has not been foundprotected DirectFieldAccessor newNestedPropertyAccessor(java.lang.Object object, java.lang.String nestedPath)
AbstractNestablePropertyAccessornewNestedPropertyAccessor in class AbstractNestablePropertyAccessorobject - object wrapped by this PropertyAccessornestedPath - the nested path of the objectprotected NotWritablePropertyException createNotWritablePropertyException(java.lang.String propertyName)
AbstractNestablePropertyAccessorNotWritablePropertyException for the specified property.createNotWritablePropertyException in class AbstractNestablePropertyAccessor