|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BindingErrorProcessor
Strategy for processing DataBinder's missing field errors,
and for translating a PropertyAccessException to a
FieldError.
The error processor is pluggable so you can treat errors differently if you want to. A default implementation is provided for typical needs.
DataBinder.setBindingErrorProcessor(org.springframework.validation.BindingErrorProcessor),
DefaultBindingErrorProcessor| Method Summary | |
|---|---|
void |
processMissingFieldError(String missingField,
BindException errors)
Apply the missing field error to the given BindException. |
void |
processPropertyAccessException(PropertyAccessException ex,
BindException errors)
Translate the given PropertyAccessException to an appropriate
error registered on the given Errors instance. |
| Method Detail |
|---|
void processMissingFieldError(String missingField,
BindException errors)
Usually, a field error is created for a missing required field.
missingField - the field that was missing during bindingerrors - the errors object to add the error(s) to. You can add more than
just one error or maybe even ignore it.BindException.addError(org.springframework.validation.ObjectError),
BindException.resolveMessageCodes(java.lang.String)
void processPropertyAccessException(PropertyAccessException ex,
BindException errors)
PropertyAccessException to an appropriate
error registered on the given Errors instance.
Note that two error types are available: FieldError and
ObjectError. Usually, field errors are created, but in certain
situations one might want to create a global ObjectError instead.
ex - the PropertyAccessException to translateerrors - the errors object to add the error(s) to. You can add more than
just one error or maybe even ignore it. The BindException object
features convenience utils such as a MessageCodesResolver to
resolve an error code into message codes.Errors,
FieldError,
ObjectError,
MessageCodesResolver,
BindException.addError(org.springframework.validation.ObjectError),
BindException.resolveMessageCodes(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||