Package org.springframework.validation
Class AbstractPropertyBindingResult
java.lang.Object
org.springframework.validation.AbstractErrors
org.springframework.validation.AbstractBindingResult
org.springframework.validation.AbstractPropertyBindingResult
- All Implemented Interfaces:
- Serializable,- BindingResult,- Errors
- Direct Known Subclasses:
- BeanPropertyBindingResult,- DirectFieldBindingResult
Abstract base class for 
BindingResult implementations that work with
 Spring's PropertyAccessor mechanism.
 Pre-implements field access through delegation to the corresponding
 PropertyAccessor methods.- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from interface org.springframework.validation.BindingResultMODEL_KEY_PREFIXFields inherited from interface org.springframework.validation.ErrorsNESTED_PATH_SEPARATOR
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractPropertyBindingResult(String objectName) Create a new AbstractPropertyBindingResult instance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected StringcanonicalFieldName(String field) Returns the canonical property name.findEditor(String field, Class<?> valueType) This implementation exposes a PropertyEditor adapter for a Formatter, if applicable.protected ObjectformatFieldValue(String field, Object value) Formats the field value based on registered PropertyEditors.protected ObjectgetActualFieldValue(String field) Fetches the field value from the PropertyAccessor.protected PropertyEditorgetCustomEditor(String fixedField) Retrieve the custom PropertyEditor for the given field, if any.Class<?>getFieldType(String field) Determines the field type from the property type.abstract ConfigurablePropertyAccessorProvide the PropertyAccessor to work with, according to the concrete strategy of access.Returns the underlying PropertyAccessor.voidinitConversion(ConversionService conversionService) Methods inherited from class org.springframework.validation.AbstractBindingResultaddAllErrors, addError, equals, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, getTarget, hasErrors, hashCode, recordFieldValue, recordSuppressedField, reject, rejectValue, resolveMessageCodes, resolveMessageCodes, setMessageCodesResolverMethods inherited from class org.springframework.validation.AbstractErrorsdoSetNestedPath, fixedField, getFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.validation.ErrorsgetFieldErrorCount, getFieldErrorCount, getGlobalErrorCount, getNestedPath, hasFieldErrors, hasFieldErrors, hasGlobalErrors, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath
- 
Constructor Details- 
AbstractPropertyBindingResultCreate a new AbstractPropertyBindingResult instance.- Parameters:
- objectName- the name of the target object
- See Also:
 
 
- 
- 
Method Details- 
initConversion
- 
getPropertyEditorRegistryReturns the underlying PropertyAccessor.- Specified by:
- getPropertyEditorRegistryin interface- BindingResult
- Overrides:
- getPropertyEditorRegistryin class- AbstractBindingResult
- Returns:
- the PropertyEditorRegistry, or nullif none available for this BindingResult
- See Also:
 
- 
canonicalFieldNameReturns the canonical property name.- Overrides:
- canonicalFieldNamein class- AbstractErrors
- Parameters:
- field- the original field name
- Returns:
- the canonical field name
- See Also:
 
- 
getFieldTypeDetermines the field type from the property type.- Specified by:
- getFieldTypein interface- Errors
- Overrides:
- getFieldTypein class- AbstractBindingResult
- Parameters:
- field- the field name
- Returns:
- the type of the field, or nullif not determinable
- See Also:
 
- 
getActualFieldValueFetches the field value from the PropertyAccessor.- Specified by:
- getActualFieldValuein class- AbstractBindingResult
- Parameters:
- field- the field to check
- Returns:
- the current value of the field
- See Also:
 
- 
formatFieldValueFormats the field value based on registered PropertyEditors.- Overrides:
- formatFieldValuein class- AbstractBindingResult
- Parameters:
- field- the field to check
- value- the value of the field (either a rejected value other than from a binding error, or an actual field value)
- Returns:
- the formatted value
- See Also:
 
- 
getCustomEditorRetrieve the custom PropertyEditor for the given field, if any.- Parameters:
- fixedField- the fully qualified field name
- Returns:
- the custom PropertyEditor, or null
 
- 
findEditorThis implementation exposes a PropertyEditor adapter for a Formatter, if applicable.- Specified by:
- findEditorin interface- BindingResult
- Overrides:
- findEditorin class- AbstractBindingResult
- Parameters:
- field- the path of the property (name or nested path), or- nullif looking for an editor for all properties of the given type
- valueType- the type of the property (can be- nullif a property is given but should be specified in any case for consistency checking)
- Returns:
- the registered editor, or nullif none
 
- 
getPropertyAccessorProvide the PropertyAccessor to work with, according to the concrete strategy of access.Note that a PropertyAccessor used by a BindingResult should always have its "extractOldValueForEditor" flag set to "true" by default, since this is typically possible without side effects for model objects that serve as data binding target. 
 
-