|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.validation.AbstractErrors org.springframework.validation.AbstractBindingResult org.springframework.validation.AbstractPropertyBindingResult
public abstract class AbstractPropertyBindingResult
Abstract base class for BindingResult
implementations that work with
Spring's PropertyAccessor
mechanism.
Pre-implements field access through delegation to the corresponding
PropertyAccessor methods.
getPropertyAccessor()
,
PropertyAccessor
,
ConfigurablePropertyAccessor
,
Serialized FormField 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 | |
---|---|
protected |
AbstractPropertyBindingResult(String objectName)
Create a new AbstractPropertyBindingResult instance. |
Method Summary | |
---|---|
protected String |
canonicalFieldName(String field)
Returns the canonical property name. |
protected Object |
formatFieldValue(String field,
Object value)
Formats the field value based on registered PropertyEditors. |
protected Object |
getActualFieldValue(String field)
Fetches the field value from the PropertyAccessor. |
protected PropertyEditor |
getCustomEditor(String field)
Retrieve the custom PropertyEditor for the given field, if any. |
Class |
getFieldType(String field)
Determines the field type from the property type. |
abstract ConfigurablePropertyAccessor |
getPropertyAccessor()
Provide the PropertyAccessor to work with, according to the concrete strategy of access. |
PropertyEditorRegistry |
getPropertyEditorRegistry()
Returns the underlying PropertyAccessor. |
Methods inherited from class org.springframework.validation.AbstractBindingResult |
---|
addAllErrors, addError, equals, findEditor, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrors, getFieldErrors, getFieldValue, getGlobalError, getGlobalErrors, getMessageCodesResolver, getModel, getObjectName, getRawFieldValue, getSuppressedFields, getTarget, 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 |
---|
protected AbstractPropertyBindingResult(String objectName)
objectName
- the name of the target objectDefaultMessageCodesResolver
Method Detail |
---|
public PropertyEditorRegistry getPropertyEditorRegistry()
getPropertyEditorRegistry
in interface BindingResult
getPropertyEditorRegistry
in class AbstractBindingResult
null
if none
available for this BindingResultgetPropertyAccessor()
protected String canonicalFieldName(String field)
canonicalFieldName
in class AbstractErrors
field
- the original field name
PropertyAccessorUtils.canonicalPropertyName(java.lang.String)
public Class getFieldType(String field)
getFieldType
in interface Errors
getFieldType
in class AbstractBindingResult
field
- the field name
null
if not determinablegetPropertyAccessor()
protected Object getActualFieldValue(String field)
getActualFieldValue
in class AbstractBindingResult
field
- the field to check
getPropertyAccessor()
protected Object formatFieldValue(String field, Object value)
formatFieldValue
in class AbstractBindingResult
field
- the field to checkvalue
- the value of the field (either a rejected value
other than from a binding error, or an actual field value)
getCustomEditor(java.lang.String)
protected PropertyEditor getCustomEditor(String field)
field
- the field name
null
public abstract ConfigurablePropertyAccessor getPropertyAccessor()
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.
ConfigurablePropertyAccessor.setExtractOldValueForEditor(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |