Package org.springframework.validation
Class BeanPropertyBindingResult
- java.lang.Object
- org.springframework.validation.AbstractErrors
- org.springframework.validation.AbstractBindingResult
- org.springframework.validation.AbstractPropertyBindingResult
- org.springframework.validation.BeanPropertyBindingResult
- All Implemented Interfaces:
Serializable,BindingResult,Errors
public class BeanPropertyBindingResult extends AbstractPropertyBindingResult implements Serializable
Default implementation of theErrorsandBindingResultinterfaces, 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
Errorsinterface or theBindingResultinterface. ADataBinderreturns itsBindingResultviaDataBinder.getBindingResult().- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
DataBinder.getBindingResult(),DataBinder.initBeanPropertyAccess(),DirectFieldBindingResult, Serialized Form
Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIX
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR
Constructor Summary
Constructors Constructor Description BeanPropertyBindingResult(Object target, String objectName)Creates a new instance of theBeanPropertyBindingResultclass.BeanPropertyBindingResult(Object target, String objectName, boolean autoGrowNestedPaths, int autoGrowCollectionLimit)Creates a new instance of theBeanPropertyBindingResultclass.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanWrappercreateBeanWrapper()Create a newBeanWrapperfor the underlying target object.ConfigurablePropertyAccessorgetPropertyAccessor()Returns theBeanWrapperthat this instance uses.ObjectgetTarget()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
Constructor Detail
BeanPropertyBindingResult
public BeanPropertyBindingResult(Object target, String objectName)
Creates a new instance of theBeanPropertyBindingResultclass.- Parameters:
target- the target bean to bind ontoobjectName- the name of the target object
BeanPropertyBindingResult
public BeanPropertyBindingResult(Object target, String objectName, boolean autoGrowNestedPaths, int autoGrowCollectionLimit)
Creates a new instance of theBeanPropertyBindingResultclass.- Parameters:
target- the target bean to bind ontoobjectName- the name of the target objectautoGrowNestedPaths- whether to "auto-grow" a nested path that contains a null valueautoGrowCollectionLimit- the limit for array and collection auto-growing
Method Detail
getTarget
public final Object getTarget()
Description copied from class:AbstractBindingResultReturn the wrapped target object.- Specified by:
getTargetin interfaceBindingResult- Specified by:
getTargetin classAbstractBindingResult
getPropertyAccessor
public final ConfigurablePropertyAccessor getPropertyAccessor()
Returns theBeanWrapperthat this instance uses. Creates a new one if none existed before.- Specified by:
getPropertyAccessorin classAbstractPropertyBindingResult- See Also:
createBeanWrapper()
createBeanWrapper
protected BeanWrapper createBeanWrapper()
Create a newBeanWrapperfor the underlying target object.- See Also:
getTarget()