org.springframework.validation

## 类 DirectFieldBindingResult

- java.lang.Object
- - org.springframework.validation.AbstractErrors
  - - org.springframework.validation.AbstractBindingResult
    - - org.springframework.validation.AbstractPropertyBindingResult
      - - org.springframework.validation.DirectFieldBindingResult

- 所有已实现的接口:
    Serializable, BindingResult, Errors

      public class DirectFieldBindingResult
      extends AbstractPropertyBindingResult

  Special implementation of the Errors and BindingResult interfaces, supporting registration and evaluation of binding errors on value objects. Performs direct field access instead of going through JavaBean getters.

  Since Spring 4.1 this implementation is able to traverse nested fields.

  从以下版本开始:
    2.0
  作者:
    Juergen Hoeller
  另请参阅:
    `DataBinder.getBindingResult()`, `DataBinder.initDirectFieldAccess()`, `BeanPropertyBindingResult`, 序列化表格

- - ### 字段概要

    - ### 从接口继承的字段 org.springframework.validation.BindingResult

      `MODEL_KEY_PREFIX`

    - ### 从接口继承的字段 org.springframework.validation.Errors

      `NESTED_PATH_SEPARATOR`

  - ### 构造器概要

    构造器
    构造器和说明
    `DirectFieldBindingResult(Object target, String objectName)` Create a new DirectFieldBindingResult instance.
    `DirectFieldBindingResult(Object target, String objectName, boolean autoGrowNestedPaths)` Create a new DirectFieldBindingResult instance.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected org.springframework.beans.ConfigurablePropertyAccessor` | `createDirectFieldAccessor()` Create a new DirectFieldAccessor for the underlying target object.
    `org.springframework.beans.ConfigurablePropertyAccessor` | `getPropertyAccessor()` Returns the DirectFieldAccessor that this instance uses.
    `Object` | `getTarget()` Return the wrapped target object.

    - ### 从类继承的方法 org.springframework.validation.AbstractPropertyBindingResult

      `canonicalFieldName, findEditor, formatFieldValue, getActualFieldValue, getCustomEditor, getFieldType, getPropertyEditorRegistry, initConversion`

    - ### 从类继承的方法 org.springframework.validation.AbstractBindingResult

      `addAllErrors, addError, equals, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, hasErrors, hashCode, recordFieldValue, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver`

    - ### 从类继承的方法 org.springframework.validation.AbstractErrors

      `doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString`

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

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

    - ### 从接口继承的方法 org.springframework.validation.Errors

      `getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath`

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

    - #### DirectFieldBindingResult

          public DirectFieldBindingResult(@Nullable
                                          Object target,
                                          String objectName)

      Create a new DirectFieldBindingResult instance.
      参数:
        `target` - the target object to bind onto
        `objectName` - the name of the target object

    - #### DirectFieldBindingResult

          public DirectFieldBindingResult(@Nullable
                                          Object target,
                                          String objectName,
                                          boolean autoGrowNestedPaths)

      Create a new DirectFieldBindingResult instance.
      参数:
        `target` - the target object to bind onto
        `objectName` - the name of the target object
        `autoGrowNestedPaths` - whether to "auto-grow" a nested path that contains a null value

  - ### 方法详细资料

    - #### getTarget

          @Nullable
          public final Object getTarget()

      从类复制的说明: `AbstractBindingResult`
      Return the wrapped target object.
      指定者:
        `getTarget` 在接口中 `BindingResult`
      指定者:
        `getTarget` 在类中 `AbstractBindingResult`

    - #### getPropertyAccessor

          public final org.springframework.beans.ConfigurablePropertyAccessor getPropertyAccessor()

      Returns the DirectFieldAccessor that this instance uses. Creates a new one if none existed before.
      指定者:
        `getPropertyAccessor` 在类中 `AbstractPropertyBindingResult`
      另请参阅:
        `createDirectFieldAccessor()`

    - #### createDirectFieldAccessor

          protected org.springframework.beans.ConfigurablePropertyAccessor createDirectFieldAccessor()

      Create a new DirectFieldAccessor for the underlying target object.
      另请参阅:
        `getTarget()`