ServerWebInputException subclass that indicates a data binding or
validation failure.
| Modifier and Type | Field and Description |
|---|---|
| private final BindingResult |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAllErrors(Errors
the errors)Errors instance to merge inOverrides default org. Add all errors from the given |
| public void | addError(ObjectError error)
Implements org. Add a custom |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public PropertyEditor | findEditor(String
the path of the property (name or nested path), or
field, Class<T> null if looking for an editor for all properties of the given typethe type of the property (can be valueType)null if a property
is given but should be specified in any case for consistency checking)Implements org. Find a custom property editor for the given type and property. |
| public List | getAllErrors()
Overrides default org. Get all errors, both global and field ones. |
| public final BindingResult | |
| public Object[] | getDetailMessageArguments()
Overrides org. Overrides default org. Return arguments to use along with a |
| public Object[] | getDetailMessageArguments(MessageSource
the source, Locale MessageSource to use for the lookupthe locale)Locale to use for the lookupOverrides default org. Variant of |
| public int | getErrorCount()
Overrides default org. Determine the total number of errors. |
| public FieldError | getFieldError()
Overrides default org. Get the first error associated with a field, if any. |
| public FieldError | getFieldError(String
the field name field)Overrides default org. Get the first error associated with the given field, if any. |
| public int | getFieldErrorCount()
Overrides default org. Determine the number of errors associated with a field. |
| public int | getFieldErrorCount(String
the field name field)Overrides default org. Determine the number of errors associated with the given field. |
| public List | getFieldErrors()
Implements org. Get all errors associated with a field. |
| public List | getFieldErrors(String
the field name field)Overrides default org. Get all errors associated with the given field. |
| public Class | getFieldType(String
the field name field)Overrides default org. Determine the type of the given field, as far as possible. |
| public Object | getFieldValue(String
the field name field)Implements org. Return the current value of the given field, either the current bean property value or a rejected update from the last binding. |
| public ObjectError | getGlobalError()
Overrides default org. Get the first global error, if any. |
| public int | getGlobalErrorCount()
Overrides default org. Determine the number of global errors. |
| public List | getGlobalErrors()
Implements org. Get all global errors. |
| public String | getMessage()
Overrides org. Returns diagnostic information about the errors held in this object. |
| public Map | getModel()
Implements org. Return a model Map for the obtained state, exposing a BindingResult
instance as ' |
| public String | getNestedPath()
Overrides default org. Return the current nested path of this |
| public String | getObjectName()
Implements org. Return the name of the bound root object. |
| public PropertyEditorRegistry | getPropertyEditorRegistry()
Implements org. Return the underlying PropertyEditorRegistry. |
| public Object | getRawFieldValue(String
the field to check field)Implements org. Extract the raw field value for the given field. |
| public String[] | getSuppressedFields()
Overrides default org. Return the list of fields that were suppressed during the bind process. |
| public Object | getTarget()
Implements org. Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy. |
| public boolean | hasErrors()
Overrides default org. Determine if there were any errors. |
| public boolean | hasFieldErrors()
Overrides default org. Determine if there were any errors associated with a field. |
| public boolean | hasFieldErrors(String
the field name field)Overrides default org. Determine if there were any errors associated with the given field. |
| public boolean | hasGlobalErrors()
Overrides default org. Determine if there were any global errors. |
| public int | |
| public void | popNestedPath()
Overrides default org. Pop the former nested path from the nested path stack. |
| public void | pushNestedPath(String
the sub path to push onto the nested path stack subPath)Overrides default org. Push the given sub path onto the nested path stack. |
| public void | recordFieldValue(String
the field to record the value for field, Class<?> the type of the field type, Object the original value value)Overrides default org. Record the given value for the specified field. |
| public void | recordSuppressedField(String field)
Overrides default org. Mark the specified disallowed field as suppressed. |
| public void | reject(String
error code, interpretable as a message key errorCode)Overrides default org. Register a global error for the entire target object, using the given error description. |
| public void | reject(String
error code, interpretable as a message key errorCode, String fallback default message defaultMessage)Overrides default org. Register a global error for the entire target object, using the given error description. |
| public void | reject(String
error code, interpretable as a message key errorCode, Object[] error arguments, for argument binding via MessageFormat
(can be errorArgs, String null)fallback default message defaultMessage)Implements org. Register a global error for the entire target object, using the given error description. |
| public void | rejectValue(String
the field name (may be field, String null or empty String)error code, interpretable as a message key errorCode)Overrides default org. Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. |
| public void | rejectValue(String
the field name (may be field, String null or empty String)error code, interpretable as a message key errorCode, String fallback default message defaultMessage)Overrides default org. Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. |
| public void | rejectValue(String
the field name (may be field, String null or empty String)error code, interpretable as a message key errorCode, Object[] error arguments, for argument binding via MessageFormat
(can be errorArgs, String null)fallback default message defaultMessage)Implements org. Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. |
| public Map | Returns: a Map with errors as key and resolves messages as value
Deprecated
for removal since 6.1. in favor of using
BindErrorUtils and
getAllErrors(), to be removed in 6.2
Resolve global and field errors to messages with the given
|
| public String[] | resolveMessageCodes(String
the error code to resolve into message codes errorCode)Implements org. Resolve the given error code into message codes. |
| public String[] | resolveMessageCodes(String
the error code to resolve into message codes errorCode, String the field to resolve message codes for field)Implements org. Resolve the given error code into message codes for the given field. |
| public void | setNestedPath(String
nested path within this object,
e.g. "address" (defaults to "", nestedPath)null is also acceptable).
Can end with a dot: both "address" and "address." are valid.Overrides default org. Allow context to be changed so that standard validators can validate subtrees. |
| bindingResult | back to summary |
|---|---|
| private final BindingResult bindingResult | |
| WebExchangeBindException | back to summary |
|---|---|
| public WebExchangeBindException(MethodParameter parameter, BindingResult bindingResult) | |
| addAllErrors | back to summary |
|---|---|
| public void addAllErrors(Errors errors) Overrides default org. Doc from org. Add all errors from the given This is a convenience method to avoid repeated Note that the passed-in The default implementation throws | |
| addError | back to summary |
|---|---|
| public void addError(ObjectError error) Implements org. Doc from org. Add a custom Intended to be used by cooperating strategies such as
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| findEditor | back to summary |
|---|---|
| public PropertyEditor findEditor(String field, Class<T> valueType) Implements org. Doc from org. Find a custom property editor for the given type and property.
| |
| getAllErrors | back to summary |
|---|---|
| public List Overrides default org. Doc from org. Get all errors, both global and field ones.
| |
| getBindingResult | back to summary |
|---|---|
| public final BindingResult getBindingResult() Return the BindingResult that this BindException wraps. Will typically be a BeanPropertyBindingResult.
| |
| getDetailMessageArguments | back to summary |
|---|---|
| public Object[] getDetailMessageArguments() Overrides org. Overrides default org. Doc from org. Return arguments to use along with a
| |
| getDetailMessageArguments | back to summary |
|---|---|
| public Object[] getDetailMessageArguments(MessageSource source, Locale locale) Overrides default org. Doc from org. Variant of This is useful for example to expand message codes from validation errors. The default implementation delegates to
| |
| getErrorCount | back to summary |
|---|---|
| public int getErrorCount() Overrides default org. Doc from org. Determine the total number of errors.
| |
| getFieldError | back to summary |
|---|---|
| public FieldError getFieldError() Overrides default org. Doc from org. Get the first error associated with a field, if any.
| |
| getFieldError | back to summary |
|---|---|
| public FieldError getFieldError(String field) Overrides default org. Doc from org. Get the first error associated with the given field, if any.
| |
| getFieldErrorCount | back to summary |
|---|---|
| public int getFieldErrorCount() Overrides default org. Doc from org. Determine the number of errors associated with a field.
| |
| getFieldErrorCount | back to summary |
|---|---|
| public int getFieldErrorCount(String field) Overrides default org. Doc from org. Determine the number of errors associated with the given field. | |
| getFieldErrors | back to summary |
|---|---|
| public List Implements org. Doc from org. Get all errors associated with a field.
| |
| getFieldErrors | back to summary |
|---|---|
| public List Overrides default org. Doc from org. Get all errors associated with the given field. Implementations may support not only full field names like "address.street" but also pattern matches like "address.*".
| |
| getFieldType | back to summary |
|---|---|
| public Class Overrides default org. Doc from org. Determine the type of the given field, as far as possible. Implementations should be able to determine the type even
when the field value is | |
| getFieldValue | back to summary |
|---|---|
| public Object getFieldValue(String field) Implements org. Doc from org. Return the current value of the given field, either the current bean property value or a rejected update from the last binding. Allows for convenient access to user-specified field values, even if there were type mismatches. | |
| getGlobalError | back to summary |
|---|---|
| public ObjectError getGlobalError() Overrides default org. Doc from org. Get the first global error, if any.
| |
| getGlobalErrorCount | back to summary |
|---|---|
| public int getGlobalErrorCount() Overrides default org. Doc from org. Determine the number of global errors.
| |
| getGlobalErrors | back to summary |
|---|---|
| public List Implements org. Doc from org. Get all global errors.
| |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides org. Returns diagnostic information about the errors held in this object.
| |
| getModel | back to summary |
|---|---|
| public Map Implements org. Doc from org. Return a model Map for the obtained state, exposing a BindingResult
instance as ' Note that the Map is constructed every time you're calling this method. Adding things to the map and then re-calling this method will not work. The attributes in the model Map returned by this method are usually
included in the
| |
| getNestedPath | back to summary |
|---|---|
| public String getNestedPath() Overrides default org. Doc from org. Return the current nested path of this Returns a nested path with a dot, i.e. "address.", for easy building of concatenated paths. Default is an empty String.
| |
| getObjectName | back to summary |
|---|---|
| public String getObjectName() Implements org. Doc from org. Return the name of the bound root object.
| |
| getPropertyEditorRegistry | back to summary |
|---|---|
| public PropertyEditorRegistry getPropertyEditorRegistry() Implements org. Doc from org. Return the underlying PropertyEditorRegistry.
| |
| getRawFieldValue | back to summary |
|---|---|
| public Object getRawFieldValue(String field) Implements org. Doc from org. Extract the raw field value for the given field. Typically used for comparison purposes. | |
| getSuppressedFields | back to summary |
|---|---|
| public String[] getSuppressedFields() Overrides default org. Doc from org. Return the list of fields that were suppressed during the bind process. Can be used to determine whether any field values were targeting disallowed fields.
| |
| getTarget | back to summary |
|---|---|
| public Object getTarget() Implements org. Doc from org. Return the wrapped target object, which may be a bean, an object with public fields, a Map - depending on the concrete binding strategy. | |
| hasErrors | back to summary |
|---|---|
| public boolean hasErrors() Overrides default org. Doc from org. Determine if there were any errors.
| |
| hasFieldErrors | back to summary |
|---|---|
| public boolean hasFieldErrors() Overrides default org. Doc from org. Determine if there were any errors associated with a field.
| |
| hasFieldErrors | back to summary |
|---|---|
| public boolean hasFieldErrors(String field) Overrides default org. Doc from org. Determine if there were any errors associated with the given field. | |
| hasGlobalErrors | back to summary |
|---|---|
| public boolean hasGlobalErrors() Overrides default org. Doc from org. Determine if there were any global errors.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| popNestedPath | back to summary |
|---|---|
| public void popNestedPath() throws IllegalStateException Overrides default org. Doc from org. Pop the former nested path from the nested path stack.
| |
| pushNestedPath | back to summary |
|---|---|
| public void pushNestedPath(String subPath) Overrides default org. Doc from org. Push the given sub path onto the nested path stack. A Using the nested path stack allows to set temporary nested paths for subobjects without having to worry about a temporary path holder. For example: current path "spouse.", pushNestedPath("child") → result path "spouse.child."; popNestedPath() → "spouse." again. The default implementation throws | |
| recordFieldValue | back to summary |
|---|---|
| public void recordFieldValue(String field, Class<?> type, Object value) Overrides default org. Doc from org. Record the given value for the specified field. To be used when a target object cannot be constructed, making
the original field values available through | |
| recordSuppressedField | back to summary |
|---|---|
| public void recordSuppressedField(String field) Overrides default org. Doc from org. Mark the specified disallowed field as suppressed. The data binder invokes this for each field value that was detected to target a disallowed field.
| |
| reject | back to summary |
|---|---|
| public void reject(String errorCode) Overrides default org. Doc from org. Register a global error for the entire target object, using the given error description. | |
| reject | back to summary |
|---|---|
| public void reject(String errorCode, String defaultMessage) Overrides default org. Doc from org. Register a global error for the entire target object, using the given error description. | |
| reject | back to summary |
|---|---|
| public void reject(String errorCode, Object[] errorArgs, String defaultMessage) Implements org. Doc from org. Register a global error for the entire target object, using the given error description. | |
| rejectValue | back to summary |
|---|---|
| public void rejectValue(String field, String errorCode) Overrides default org. Doc from org. Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. The field name may be | |
| rejectValue | back to summary |
|---|---|
| public void rejectValue(String field, String errorCode, String defaultMessage) Overrides default org. Doc from org. Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. The field name may be | |
| rejectValue | back to summary |
|---|---|
| public void rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) Implements org. Doc from org. Register a field error for the specified field of the current object (respecting the current nested path, if any), using the given error description. The field name may be | |
| resolveErrorMessages | back to summary |
|---|---|
| public Map Deprecated for removal since 6.1. in favor of using Resolve global and field errors to messages with the given
| |
| resolveMessageCodes | back to summary |
|---|---|
| public String[] resolveMessageCodes(String errorCode) Implements org. Doc from org. Resolve the given error code into message codes. Calls the configured | |
| resolveMessageCodes | back to summary |
|---|---|
| public String[] resolveMessageCodes(String errorCode, String field) Implements org. Doc from org. Resolve the given error code into message codes for the given field. Calls the configured | |
| setNestedPath | back to summary |
|---|---|
| public void setNestedPath(String nestedPath) Overrides default org. Doc from org. Allow context to be changed so that standard validators can validate subtrees. Reject calls prepend the given path to the field names. For example, an address validator could validate the subobject "address" of a customer object. The default implementation throws | |