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.
setExtractOldValueForEditor, BeanWrapper, org.springframework.validation.DirectFieldBindingResult , org.springframework.validation.DataBinder#initDirectFieldAccess()
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | DirectFieldAccessor(Object
the object wrapped by this DirectFieldAccessor object)Create a new DirectFieldAccessor for the given object. |
| protected | DirectFieldAccessor(Object
the object wrapped by this DirectFieldAccessor object, String the nested path of the object nestedPath, DirectFieldAccessor the containing DirectFieldAccessor (must not be parent)null)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(String propertyName)
Implements abstract org. Create a |
| protected DirectFieldAccessor. | getLocalPropertyHandler(String
the name of a local property propertyName)Implements abstract org. Return a |
| protected DirectFieldAccessor | newNestedPropertyAccessor(Object
the object wrapped by this PropertyAccessor object, String the nested path of the object nestedPath)Implements abstract org. Create a new nested property accessor instance. |
| fieldMap | back to summary |
|---|---|
| private final Map<String, DirectFieldAccessor. | |
| DirectFieldAccessor | back to summary |
|---|---|
| public DirectFieldAccessor(Object object) Create a new DirectFieldAccessor for the given object.
| |
| DirectFieldAccessor | back to summary |
|---|---|
| protected DirectFieldAccessor(Object object, String nestedPath, DirectFieldAccessor parent) Create a new DirectFieldAccessor for the given object, registering a nested path that the object is in.
| |
| createNotWritablePropertyException | back to summary |
|---|---|
| protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) Implements abstract org. Doc from org. Create a
| |
| getLocalPropertyHandler | back to summary |
|---|---|
| protected DirectFieldAccessor. Implements abstract org. Doc from org. Return a
| |
| newNestedPropertyAccessor | back to summary |
|---|---|
| protected DirectFieldAccessor newNestedPropertyAccessor(Object object, String nestedPath) Implements abstract org. Doc from org. Create a new nested property accessor instance. Can be overridden in subclasses to create a PropertyAccessor subclass.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Field | |
| private final ResolvableType |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public TypeDescriptor | getCollectionType(int nestingLevel)
Overrides org.
|
| public TypeDescriptor | getMapValueType(int nestingLevel)
Overrides org.
|
| public ResolvableType | |
| public Object | getValue()
Implements abstract org.
|
| public TypeDescriptor | nested(int level)
Implements abstract org.
|
| public void | setValue(Object value)
Implements abstract org.
|
| public TypeDescriptor |
| field | back to summary |
|---|---|
| private final Field field | |
| resolvableType | back to summary |
|---|---|
| private final ResolvableType resolvableType | |
| FieldPropertyHandler | back to summary |
|---|---|
| public FieldPropertyHandler(Field field) | |
| getCollectionType | back to summary |
|---|---|
| public TypeDescriptor getCollectionType(int nestingLevel) Overrides org.
| |
| getMapValueType | back to summary |
|---|---|
| public TypeDescriptor getMapValueType(int nestingLevel) Overrides org.
| |
| getResolvableType | back to summary |
|---|---|
| public ResolvableType getResolvableType() Implements abstract org.
| |
| getValue | back to summary |
|---|---|
| public Object getValue() throws Exception Implements abstract org. | |
| nested | back to summary |
|---|---|
| public TypeDescriptor nested(int level) Implements abstract org. | |
| setValue | back to summary |
|---|---|
| public void setValue(Object value) throws Exception Implements abstract org.
| |
| toTypeDescriptor | back to summary |
|---|---|
| public TypeDescriptor toTypeDescriptor() Implements abstract org.
| |