public class DefaultBindingErrorProcessor extends java.lang.Object implements BindingErrorProcessor
Title: DefaultBindingErrorProcessor.java
Description:
bboss workgroup
Copyright (c) 2007
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
MISSING_FIELD_ERROR_CODE
Error code that a missing field error (i.e. a required field not
found in the list of property values) will be registered with:
"required".
|
| 构造器和说明 |
|---|
DefaultBindingErrorProcessor() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected java.lang.Object[] |
getArgumentsForBindError(java.lang.String objectName,
java.lang.String field)
Return FieldError arguments for a binding error on the given field.
|
void |
processMissingFieldError(java.lang.String missingField,
BindingResult bindingResult)
Apply the missing field error to the given BindException.
|
void |
processPropertyAccessException(org.frameworkset.util.beans.PropertyAccessException ex,
BindingResult bindingResult)
Translate the given
PropertyAccessException to an appropriate
error registered on the given Errors instance. |
public static final java.lang.String MISSING_FIELD_ERROR_CODE
public void processMissingFieldError(java.lang.String missingField,
BindingResult bindingResult)
BindingErrorProcessorUsually, a field error is created for a missing required field.
processMissingFieldError 在接口中 BindingErrorProcessormissingField - the field that was missing during bindingbindingResult - the errors object to add the error(s) to.
You can add more than just one error or maybe even ignore it.
The BindingResult object features convenience utils such as
a resolveMessageCodes method to resolve an error code.BeanPropertyBindingResult#addError,
BeanPropertyBindingResult#resolveMessageCodespublic void processPropertyAccessException(org.frameworkset.util.beans.PropertyAccessException ex,
BindingResult bindingResult)
BindingErrorProcessorPropertyAccessException 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.
processPropertyAccessException 在接口中 BindingErrorProcessorex - the PropertyAccessException to translatebindingResult - the errors object to add the error(s) to.
You can add more than just one error or maybe even ignore it.
The BindingResult object features convenience utils such as
a resolveMessageCodes method to resolve an error code.Errors,
FieldError,
ObjectError,
MessageCodesResolver,
BeanPropertyBindingResult#addError,
BeanPropertyBindingResult#resolveMessageCodesprotected java.lang.Object[] getArgumentsForBindError(java.lang.String objectName,
java.lang.String field)
Default implementation returns a DefaultMessageSourceResolvable with "objectName.field" and "field" as codes.
field - the field that caused the binding error