public class DirectFieldBindingResult extends AbstractPropertyBindingResult
Since Spring 4.1 this implementation is able to traverse nested fields.
DataBinder.getBindingResult()
,
DataBinder.initDirectFieldAccess()
,
BeanPropertyBindingResult
,
Serialized FormModifier and Type | Field and Description |
---|---|
private boolean |
autoGrowNestedPaths |
private ConfigurablePropertyAccessor |
directFieldAccessor |
private java.lang.Object |
target |
MODEL_KEY_PREFIX
NESTED_PATH_SEPARATOR
Constructor and Description |
---|
DirectFieldBindingResult(java.lang.Object target,
java.lang.String objectName)
Create a new DirectFieldBindingResult instance.
|
DirectFieldBindingResult(java.lang.Object target,
java.lang.String objectName,
boolean autoGrowNestedPaths)
Create a new DirectFieldBindingResult instance.
|
Modifier and Type | Method and Description |
---|---|
protected ConfigurablePropertyAccessor |
createDirectFieldAccessor()
Create a new DirectFieldAccessor for the underlying target object.
|
ConfigurablePropertyAccessor |
getPropertyAccessor()
Returns the DirectFieldAccessor that this instance uses.
|
java.lang.Object |
getTarget()
Return the wrapped target object.
|
canonicalFieldName, findEditor, formatFieldValue, getActualFieldValue, getCustomEditor, getFieldType, getPropertyEditorRegistry, initConversion
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
doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath
@Nullable private final java.lang.Object target
private final boolean autoGrowNestedPaths
@Nullable private transient ConfigurablePropertyAccessor directFieldAccessor
public DirectFieldBindingResult(@Nullable java.lang.Object target, java.lang.String objectName)
target
- the target object to bind ontoobjectName
- the name of the target objectpublic DirectFieldBindingResult(@Nullable java.lang.Object target, java.lang.String objectName, boolean autoGrowNestedPaths)
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@Nullable public final java.lang.Object getTarget()
AbstractBindingResult
getTarget
in interface BindingResult
getTarget
in class AbstractBindingResult
public final ConfigurablePropertyAccessor getPropertyAccessor()
getPropertyAccessor
in class AbstractPropertyBindingResult
createDirectFieldAccessor()
protected ConfigurablePropertyAccessor createDirectFieldAccessor()
getTarget()