Top Description Fields Constructors Methods
org.springframework.web.bind.support

public Class WebExchangeBindException

extends ServerWebInputException
implements BindingResult
Class Inheritance
All Implemented Interfaces
org.springframework.validation.BindingResult, org.springframework.validation.Errors
Annotations
@SuppressWarnings:serial
Imports
java.beans.PropertyEditor, java.util.List, .Locale, .Map, org.springframework.beans.PropertyEditorRegistry, org.springframework.context.MessageSource, org.springframework.core.MethodParameter, org.springframework.lang.Nullable, org.springframework.util.Assert, org.springframework.validation.BeanPropertyBindingResult, .BindingResult, .Errors, .FieldError, .ObjectError, org.springframework.web.server.ServerWebInputException, org.springframework.web.util.BindErrorUtils

ServerWebInputException subclass that indicates a data binding or validation failure.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final BindingResult

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addAllErrors(Errors
the Errors instance to merge in
errors
)

Overrides default org.springframework.validation.Errors.addAllErrors.

Add all errors from the given Errors instance to this Errors instance.
public void
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public PropertyEditor
findEditor(String
the path of the property (name or nested path), or null if looking for an editor for all properties of the given type
field
,
Class<T>
the type of the property (can be null if a property is given but should be specified in any case for consistency checking)
valueType
)

Implements org.springframework.validation.BindingResult.findEditor.

Find a custom property editor for the given type and property.
public List<ObjectError>
getAllErrors()

Overrides default org.springframework.validation.Errors.getAllErrors.

Get all errors, both global and field ones.
public final BindingResult
getBindingResult()

Return the BindingResult that this BindException wraps.

public Object[]
getDetailMessageArguments()

Overrides org.springframework.web.ErrorResponseException.getDetailMessageArguments.

Overrides default org.springframework.web.ErrorResponse.getDetailMessageArguments.

Return arguments to use along with a message code to resolve the problem "detail" for this exception through a MessageSource.
public Object[]
getDetailMessageArguments(MessageSource
the MessageSource to use for the lookup
source
,
Locale
the Locale to use for the lookup
locale
)

Overrides default org.springframework.web.ErrorResponse.getDetailMessageArguments.

Variant of getDetailMessageArguments() that uses the given MessageSource for resolving the message argument values.
public int
getErrorCount()

Overrides default org.springframework.validation.Errors.getErrorCount.

Determine the total number of errors.
public FieldError
getFieldError()

Overrides default org.springframework.validation.Errors.getFieldError.

Get the first error associated with a field, if any.
public FieldError
getFieldError(String
the field name
field
)

Overrides default org.springframework.validation.Errors.getFieldError.

Get the first error associated with the given field, if any.
public int
getFieldErrorCount()

Overrides default org.springframework.validation.Errors.getFieldErrorCount.

Determine the number of errors associated with a field.
public int
getFieldErrorCount(String
the field name
field
)

Overrides default org.springframework.validation.Errors.getFieldErrorCount.

Determine the number of errors associated with the given field.
public List<FieldError>
getFieldErrors()

Implements org.springframework.validation.Errors.getFieldErrors.

Get all errors associated with a field.
public List<FieldError>
getFieldErrors(String
the field name
field
)

Overrides default org.springframework.validation.Errors.getFieldErrors.

Get all errors associated with the given field.
public Class<?>
getFieldType(String
the field name
field
)

Overrides default org.springframework.validation.Errors.getFieldType.

Determine the type of the given field, as far as possible.
public Object
getFieldValue(String
the field name
field
)

Implements org.springframework.validation.Errors.getFieldValue.

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.springframework.validation.Errors.getGlobalError.

Get the first global error, if any.
public int
getGlobalErrorCount()

Overrides default org.springframework.validation.Errors.getGlobalErrorCount.

Determine the number of global errors.
public List<ObjectError>
public String
getMessage()

Overrides org.springframework.web.server.ResponseStatusException.getMessage.

Returns diagnostic information about the errors held in this object.
public Map<String, Object>
getModel()

Implements org.springframework.validation.BindingResult.getModel.

Return a model Map for the obtained state, exposing a BindingResult instance as 'MODEL_KEY_PREFIX + objectName' and the object itself as 'objectName'.
public String
getNestedPath()

Overrides default org.springframework.validation.Errors.getNestedPath.

Return the current nested path of this Errors object.
public String
getObjectName()

Implements org.springframework.validation.Errors.getObjectName.

Return the name of the bound root object.
public PropertyEditorRegistry
public Object
getRawFieldValue(String
the field to check
field
)

Implements org.springframework.validation.BindingResult.getRawFieldValue.

Extract the raw field value for the given field.
public String[]
getSuppressedFields()

Overrides default org.springframework.validation.BindingResult.getSuppressedFields.

Return the list of fields that were suppressed during the bind process.
public Object
getTarget()

Implements org.springframework.validation.BindingResult.getTarget.

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.springframework.validation.Errors.hasErrors.

Determine if there were any errors.
public boolean
hasFieldErrors()

Overrides default org.springframework.validation.Errors.hasFieldErrors.

Determine if there were any errors associated with a field.
public boolean
hasFieldErrors(String
the field name
field
)

Overrides default org.springframework.validation.Errors.hasFieldErrors.

Determine if there were any errors associated with the given field.
public boolean
hasGlobalErrors()

Overrides default org.springframework.validation.Errors.hasGlobalErrors.

Determine if there were any global errors.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public void
popNestedPath()

Overrides default org.springframework.validation.Errors.popNestedPath.

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.springframework.validation.Errors.pushNestedPath.

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.springframework.validation.BindingResult.recordFieldValue.

Record the given value for the specified field.
public void
recordSuppressedField(String field)

Overrides default org.springframework.validation.BindingResult.recordSuppressedField.

Mark the specified disallowed field as suppressed.
public void
reject(String
error code, interpretable as a message key
errorCode
)

Overrides default org.springframework.validation.Errors.reject.

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.springframework.validation.Errors.reject.

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 null)
errorArgs
,
String
fallback default message
defaultMessage
)

Implements org.springframework.validation.Errors.reject.

Register a global error for the entire target object, using the given error description.
public void
rejectValue(String
the field name (may be null or empty String)
field
,
String
error code, interpretable as a message key
errorCode
)

Overrides default org.springframework.validation.Errors.rejectValue.

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 null or empty String)
field
,
String
error code, interpretable as a message key
errorCode
,
String
fallback default message
defaultMessage
)

Overrides default org.springframework.validation.Errors.rejectValue.

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 null or empty String)
field
,
String
error code, interpretable as a message key
errorCode
,
Object[]
error arguments, for argument binding via MessageFormat (can be null)
errorArgs
,
String
fallback default message
defaultMessage
)

Implements org.springframework.validation.Errors.rejectValue.

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<ObjectError, String>

Returns:

a Map with errors as key and resolves messages as value
resolveErrorMessages
(MessageSource messageSource, Locale locale)

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 MessageSource and Locale.
public String[]
resolveMessageCodes(String
the error code to resolve into message codes
errorCode
)

Implements org.springframework.validation.BindingResult.resolveMessageCodes.

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.springframework.validation.BindingResult.resolveMessageCodes.

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 "", null is also acceptable). Can end with a dot: both "address" and "address." are valid.
nestedPath
)

Overrides default org.springframework.validation.Errors.setNestedPath.

Allow context to be changed so that standard validators can validate subtrees.
Inherited from org.springframework.web.server.ServerWebInputException:
getMethodParameter