org.springframework.validation
Class BeanPropertyBindingResult

java.lang.Object
  extended by org.springframework.validation.AbstractErrors
      extended by org.springframework.validation.AbstractBindingResult
          extended by org.springframework.validation.AbstractPropertyBindingResult
              extended by org.springframework.validation.BeanPropertyBindingResult
All Implemented Interfaces:
java.io.Serializable, BindingResult, Errors

public class BeanPropertyBindingResult
extends AbstractPropertyBindingResult
implements java.io.Serializable

Default implementation of the Errors and BindingResult interfaces, for the registration and evaluation of binding errors on JavaBean objects.

Performs standard JavaBean property access, also supporting nested properties. Normally, application code will work with the Errors interface or the BindingResult interface. A DataBinder returns its BindingResult via DataBinder.getBindingResult().

Since:
2.0
Author:
Juergen Hoeller
See Also:
DataBinder.getBindingResult(), DataBinder.initBeanPropertyAccess(), DirectFieldBindingResult, Serialized Form

Field Summary
private  int autoGrowCollectionLimit
           
private  boolean autoGrowNestedPaths
           
private  BeanWrapper beanWrapper
           
private  java.lang.Object target
           
 
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
 
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
 
Constructor Summary
BeanPropertyBindingResult(java.lang.Object target, java.lang.String objectName)
          Creates a new instance of the BeanPropertyBindingResult class.
BeanPropertyBindingResult(java.lang.Object target, java.lang.String objectName, boolean autoGrowNestedPaths, int autoGrowCollectionLimit)
          Creates a new instance of the BeanPropertyBindingResult class.
 
Method Summary
protected  BeanWrapper createBeanWrapper()
          Create a new BeanWrapper for the underlying target object.
 ConfigurablePropertyAccessor getPropertyAccessor()
          Returns the BeanWrapper that this instance uses.
 java.lang.Object getTarget()
          Return the wrapped target object.
 
Methods inherited from class org.springframework.validation.AbstractPropertyBindingResult
canonicalFieldName, findEditor, formatFieldValue, getActualFieldValue, getCustomEditor, getFieldType, getPropertyEditorRegistry, initConversion
 
Methods inherited from class org.springframework.validation.AbstractBindingResult
addAllErrors, addError, equals, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, hasErrors, hashCode, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolver
 
Methods inherited from class org.springframework.validation.AbstractErrors
doSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.validation.Errors
getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath
 

Field Detail

target

private final java.lang.Object target

autoGrowNestedPaths

private final boolean autoGrowNestedPaths

autoGrowCollectionLimit

private final int autoGrowCollectionLimit

beanWrapper

private transient BeanWrapper beanWrapper
Constructor Detail

BeanPropertyBindingResult

public BeanPropertyBindingResult(java.lang.Object target,
                                 java.lang.String objectName)
Creates a new instance of the BeanPropertyBindingResult class.

Parameters:
target - the target bean to bind onto
objectName - the name of the target object

BeanPropertyBindingResult

public BeanPropertyBindingResult(java.lang.Object target,
                                 java.lang.String objectName,
                                 boolean autoGrowNestedPaths,
                                 int autoGrowCollectionLimit)
Creates a new instance of the BeanPropertyBindingResult class.

Parameters:
target - the target bean to bind onto
objectName - the name of the target object
autoGrowNestedPaths - whether to "auto-grow" a nested path that contains a null value
autoGrowCollectionLimit - the limit for array and collection auto-growing
Method Detail

getTarget

public final java.lang.Object getTarget()
Description copied from class: AbstractBindingResult
Return the wrapped target object.

Specified by:
getTarget in interface BindingResult
Specified by:
getTarget in class AbstractBindingResult

getPropertyAccessor

public final ConfigurablePropertyAccessor getPropertyAccessor()
Returns the BeanWrapper that this instance uses. Creates a new one if none existed before.

Specified by:
getPropertyAccessor in class AbstractPropertyBindingResult
See Also:
createBeanWrapper()

createBeanWrapper

protected BeanWrapper createBeanWrapper()
Create a new BeanWrapper for the underlying target object.

See Also:
getTarget()