Example usage for Java org.springframework.validation BindingResult fields, constructors, methods, implement or subclass
The text is from its open source code.
String | MODEL_KEY_PREFIX Prefix for the name of the BindingResult instance in a model, followed by the object name. |
void | addAllErrors(Errors errors) Add all errors from the given Errors instance to this Errors instance. |
void | addError(ObjectError error) Add a custom ObjectError or FieldError to the errors list. |
List | getAllErrors() Get all errors, both global and field ones. |
int | getErrorCount() Return the total number of errors. |
FieldError | getFieldError(String field) Get the first error associated with the given field, if any. |
FieldError | getFieldError() Get the first error associated with a field, if any. |
int | getFieldErrorCount() Return the number of errors associated with a field. |
List | getFieldErrors() Get all errors associated with a field. |
List | getFieldErrors(String field) Get all errors associated with the given field. |
Object | getFieldValue(String field) Return the current value of the given field, either the current bean property value or a rejected update from the last binding. |
ObjectError | getGlobalError() Get the first global error, if any. |
int | getGlobalErrorCount() Return the number of global errors. |
List | getGlobalErrors() Get all global errors. |
Map | getModel() Return a model Map for the obtained state, exposing a BindingResult instance as ' #MODEL_KEY_PREFIX MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'. |
String | getNestedPath() Return the current nested path of this Errors object. |
String | getObjectName() Return the name of the bound root object. |
Object | getRawFieldValue(String field) Extract the raw field value for the given field. |
String[] | getSuppressedFields() Return the list of fields that were suppressed during the bind process. |
Object | getTarget() Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy. |
boolean | hasErrors() Return if there were any errors. |
boolean | hasFieldErrors(String field) Are there any errors associated with the given field? |
boolean | hasFieldErrors() Are there any field errors? |
boolean | hasGlobalErrors() Are there any global errors? |
void | popNestedPath() Pop the former nested path from the nested path stack. |
void | pushNestedPath(String subPath) Push the given sub path onto the nested path stack. |
void | reject(String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage) Register a global error for the entire target object, using the given error description. |
void | reject(String errorCode) Register a global error for the entire target object, using the given error description. |
void | reject(String errorCode, String defaultMessage) Register a global error for the entire target object, using the given error description. |
void | rejectValue(@Nullable String field, String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. |
void | rejectValue(@Nullable String field, String errorCode) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. |
void | rejectValue(@Nullable String field, String errorCode, String defaultMessage) Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. |
String[] | resolveMessageCodes(String errorCode, String field) Resolve the given error code into message codes for the given field. |
String[] | resolveMessageCodes(String errorCode) Resolve the given error code into message codes. |
void | setNestedPath(String nestedPath) Allow context to be changed so that standard validators can validate subtrees. |
String | toString() Returns a string representation of the object. |