Class DirectFieldBindingResult
java.lang.Object
org.springframework.validation.AbstractErrors
org.springframework.validation.AbstractBindingResult
org.springframework.validation.AbstractPropertyBindingResult
org.springframework.validation.DirectFieldBindingResult
- All Implemented Interfaces:
Serializable, BindingResult, Errors
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.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from interface BindingResult
MODEL_KEY_PREFIXFields inherited from interface Errors
NESTED_PATH_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionDirectFieldBindingResult(@Nullable Object target, String objectName) Create a newDirectFieldBindingResultfor the given target.DirectFieldBindingResult(@Nullable Object target, String objectName, boolean autoGrowNestedPaths) Create a newDirectFieldBindingResultfor the given target. -
Method Summary
Modifier and TypeMethodDescriptionprotected ConfigurablePropertyAccessorCreate a new DirectFieldAccessor for the underlying target object.Returns the DirectFieldAccessor that this instance uses.Return the wrapped target object.Methods inherited from class AbstractPropertyBindingResult
canonicalFieldName, findEditor, formatFieldValue, getActualFieldValue, getCustomEditor, getFieldType, getPropertyEditorRegistry, initConversionMethods inherited from class 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, setMessageCodesResolverMethods inherited from class AbstractErrors
doSetNestedPath, fixedField, getNestedPath, isMatchingFieldError, popNestedPath, pushNestedPath, setNestedPath, toStringMethods inherited from interface Errors
failOnError, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
-
Constructor Details
-
DirectFieldBindingResult
-
DirectFieldBindingResult
public DirectFieldBindingResult(@Nullable Object target, String objectName, boolean autoGrowNestedPaths) Create a newDirectFieldBindingResultfor the given target.- Parameters:
target- the target object to bind ontoobjectName- the name of the target objectautoGrowNestedPaths- whether to "auto-grow" a nested path that contains a null value
-
-
Method Details
-
getTarget
Description copied from class:AbstractBindingResultReturn the wrapped target object.- Specified by:
getTargetin interfaceBindingResult- Specified by:
getTargetin classAbstractBindingResult
-
getPropertyAccessor
Returns the DirectFieldAccessor that this instance uses. Creates a new one if none existed before.- Specified by:
getPropertyAccessorin classAbstractPropertyBindingResult- See Also:
-
createDirectFieldAccessor
Create a new DirectFieldAccessor for the underlying target object.- See Also:
-