Top Description Fields Constructors Methods
org.springframework.validation

public Class DirectFieldBindingResult

extends AbstractPropertyBindingResult
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.beans.ConfigurablePropertyAccessor, .PropertyAccessorFactory, org.springframework.lang.Nullable

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.

Author
Juergen Hoeller
Since
2.0
See Also
DataBinder#getBindingResult(), DataBinder#initDirectFieldAccess(), BeanPropertyBindingResult

Field Summary

Modifier and TypeField and Description
private final boolean
private transient ConfigurablePropertyAccessor
private final Object

Constructor Summary

AccessConstructor and Description
public
DirectFieldBindingResult(Object
the target object to bind onto
target
,
String
the name of the target object
objectName
)

Create a new DirectFieldBindingResult for the given target.

public
DirectFieldBindingResult(Object
the target object to bind onto
target
,
String
the name of the target object
objectName
,
boolean
whether to "auto-grow" a nested path that contains a null value
autoGrowNestedPaths
)

Create a new DirectFieldBindingResult for the given target.

Method Summary

Modifier and TypeMethod and Description
protected ConfigurablePropertyAccessor
createDirectFieldAccessor()

Create a new DirectFieldAccessor for the underlying target object.

public final ConfigurablePropertyAccessor
getPropertyAccessor()

Implements abstract org.springframework.validation.AbstractPropertyBindingResult.getPropertyAccessor.

Returns the DirectFieldAccessor that this instance uses.
public final Object
Inherited from org.springframework.validation.AbstractPropertyBindingResult:
canonicalFieldNamefindEditorformatFieldValuegetActualFieldValuegetCustomEditorgetFieldTypegetPropertyEditorRegistryinitConversion

Field Detail

autoGrowNestedPathsback to summary
private final boolean autoGrowNestedPaths
directFieldAccessorback to summary
private transient ConfigurablePropertyAccessor directFieldAccessor
Annotations
@Nullable
targetback to summary
private final Object target
Annotations
@Nullable

Constructor Detail

DirectFieldBindingResultback to summary
public DirectFieldBindingResult(Object target, String objectName)

Create a new DirectFieldBindingResult for the given target.

Parameters
target:Object

the target object to bind onto

objectName:String

the name of the target object

DirectFieldBindingResultback to summary
public DirectFieldBindingResult(Object target, String objectName, boolean autoGrowNestedPaths)

Create a new DirectFieldBindingResult for the given target.

Parameters
target:Object

the target object to bind onto

objectName:String

the name of the target object

autoGrowNestedPaths:boolean

whether to "auto-grow" a nested path that contains a null value

Method Detail

createDirectFieldAccessorback to summary
protected ConfigurablePropertyAccessor createDirectFieldAccessor()

Create a new DirectFieldAccessor for the underlying target object.

See Also
getTarget()
getPropertyAccessorback to summary
public final ConfigurablePropertyAccessor getPropertyAccessor()

Implements abstract org.springframework.validation.AbstractPropertyBindingResult.getPropertyAccessor.

Returns the DirectFieldAccessor that this instance uses. Creates a new one if none existed before.

Annotations
@Override
See Also
createDirectFieldAccessor()
getTargetback to summary
public final Object getTarget()

Implements abstract org.springframework.validation.AbstractBindingResult.getTarget.

Implements org.springframework.validation.BindingResult.getTarget.

Doc from org.springframework.validation.AbstractBindingResult.getTarget.

Return the wrapped target object.

Annotations
@Override
@Nullable