org.springframework.beans

## 类 DirectFieldAccessor

- java.lang.Object
- - org.springframework.beans.PropertyEditorRegistrySupport
  - - org.springframework.beans.TypeConverterSupport
    - - org.springframework.beans.AbstractPropertyAccessor
      - - org.springframework.beans.AbstractNestablePropertyAccessor
        - - org.springframework.beans.DirectFieldAccessor

- 所有已实现的接口:
    ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter

      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.

  从以下版本开始:
    2.0
  作者:
    Juergen Hoeller, Stephane Nicoll
  另请参阅:
    `AbstractPropertyAccessor.setExtractOldValueForEditor(boolean)`, `BeanWrapper`, `org.springframework.validation.DirectFieldBindingResult`, `org.springframework.validation.DataBinder#initDirectFieldAccess()`

- - ### 嵌套类概要

    - ### 从类继承的嵌套类/接口 org.springframework.beans.AbstractNestablePropertyAccessor

      `AbstractNestablePropertyAccessor.PropertyHandler, AbstractNestablePropertyAccessor.PropertyTokenHolder`

  - ### 字段概要

    - ### 从接口继承的字段 org.springframework.beans.PropertyAccessor

      `NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR`

  - ### 构造器概要

    构造器
    限定符 | 构造器和说明
    --- | ---
    `` | `DirectFieldAccessor(Object object)` Create a new DirectFieldAccessor for the given object.
    `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.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected NotWritablePropertyException` | `createNotWritablePropertyException(String propertyName)` Create a `NotWritablePropertyException` for the specified property.
    `protected org.springframework.beans.DirectFieldAccessor.FieldPropertyHandler` | `getLocalPropertyHandler(String propertyName)` Return a `AbstractNestablePropertyAccessor.PropertyHandler` for the specified local `propertyName`.
    `protected DirectFieldAccessor` | `newNestedPropertyAccessor(Object object, String nestedPath)` Create a new nested property accessor instance.

    - ### 从类继承的方法 org.springframework.beans.AbstractNestablePropertyAccessor

      `convertForProperty, getAutoGrowCollectionLimit, getFinalPath, getNestedPath, getPropertyAccessorForPropertyPath, getPropertyHandler, getPropertyType, getPropertyTypeDescriptor, getPropertyValue, getPropertyValue, getRootClass, getRootInstance, getWrappedClass, getWrappedInstance, isReadableProperty, isWritableProperty, setAutoGrowCollectionLimit, setPropertyValue, setPropertyValue, setPropertyValue, setWrappedInstance, setWrappedInstance, toString`

    - ### 从类继承的方法 org.springframework.beans.AbstractPropertyAccessor

      `isAutoGrowNestedPaths, isExtractOldValueForEditor, setAutoGrowNestedPaths, setExtractOldValueForEditor, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues`

    - ### 从类继承的方法 org.springframework.beans.TypeConverterSupport

      `convertIfNecessary, convertIfNecessary, convertIfNecessary`

    - ### 从类继承的方法 org.springframework.beans.PropertyEditorRegistrySupport

      `copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, overrideDefaultEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, setConversionService, useConfigValueEditors`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### 从接口继承的方法 org.springframework.beans.ConfigurablePropertyAccessor

      `getConversionService, setConversionService`

    - ### 从接口继承的方法 org.springframework.beans.PropertyEditorRegistry

      `findCustomEditor, registerCustomEditor, registerCustomEditor`

    - ### 从接口继承的方法 org.springframework.beans.TypeConverter

      `convertIfNecessary, convertIfNecessary, convertIfNecessary`

- - ### 构造器详细资料

    - #### DirectFieldAccessor

          public DirectFieldAccessor(Object object)

      Create a new DirectFieldAccessor for the given object.
      参数:
        `object` - object wrapped by this DirectFieldAccessor

    - #### DirectFieldAccessor

          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.
      参数:
        `object` - object wrapped by this DirectFieldAccessor
        `nestedPath` - the nested path of the object
        `parent` - the containing DirectFieldAccessor (must not be `null`)

  - ### 方法详细资料

    - #### getLocalPropertyHandler

          @Nullable
          protected org.springframework.beans.DirectFieldAccessor.FieldPropertyHandler getLocalPropertyHandler(String propertyName)

      从类复制的说明: `AbstractNestablePropertyAccessor`
      Return a `AbstractNestablePropertyAccessor.PropertyHandler` for the specified local `propertyName`. Only used to reach a property available in the current context.
      指定者:
        `getLocalPropertyHandler` 在类中 `AbstractNestablePropertyAccessor`
      参数:
        `propertyName` - the name of a local property
      返回:
        the handler for that property, or `null` if it has not been found

    - #### newNestedPropertyAccessor

          protected DirectFieldAccessor newNestedPropertyAccessor(Object object,
                                                                  String nestedPath)

      从类复制的说明: `AbstractNestablePropertyAccessor`
      Create a new nested property accessor instance. Can be overridden in subclasses to create a PropertyAccessor subclass.
      指定者:
        `newNestedPropertyAccessor` 在类中 `AbstractNestablePropertyAccessor`
      参数:
        `object` - object wrapped by this PropertyAccessor
        `nestedPath` - the nested path of the object
      返回:
        the nested PropertyAccessor instance

    - #### createNotWritablePropertyException

          protected NotWritablePropertyException createNotWritablePropertyException(String propertyName)

      从类复制的说明: `AbstractNestablePropertyAccessor`
      Create a `NotWritablePropertyException` for the specified property.
      指定者:
        `createNotWritablePropertyException` 在类中 `AbstractNestablePropertyAccessor`