Package org.springframework.web.bind.support

# Class WebExchangeBindException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.ErrorResponseException
org.springframework.web.server.ResponseStatusException
org.springframework.web.server.ServerWebInputException
org.springframework.web.bind.support.WebExchangeBindException

All Implemented Interfaces:
  `Serializable`, `org.springframework.validation.BindingResult`, `org.springframework.validation.Errors`, `ErrorResponse`

public class WebExchangeBindException extends ServerWebInputException implements org.springframework.validation.BindingResult
`ServerWebInputException` subclass that indicates a data binding or validation failure.

Since:
  5.0
Author:
  Rossen Stoyanchev
See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.springframework.web.ErrorResponse

`ErrorResponse.Builder, ErrorResponse.Interceptor`

## Field Summary

### Fields inherited from interface org.springframework.validation.BindingResult

`MODEL_KEY_PREFIX`

### Fields inherited from interface org.springframework.validation.Errors

`NESTED_PATH_SEPARATOR`

## Constructor Summary

Constructors
Constructor
Description
`WebExchangeBindException(org.springframework.core.MethodParameter parameter, org.springframework.validation.BindingResult bindingResult)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addAllErrors(org.springframework.validation.Errors errors)`
`void`
`addError(org.springframework.validation.ObjectError error)`
`boolean`
`equals(Object other)`
`PropertyEditor`
`findEditor(String field, Class valueType)`
`List<org.springframework.validation.ObjectError>`
`getAllErrors()`
`final org.springframework.validation.BindingResult`
`getBindingResult()`
Return the BindingResult that this BindException wraps.
`Object[]`
`getDetailMessageArguments()`
Return arguments to use along with a `message code` to resolve the problem "detail" for this exception through a `MessageSource`.
`Object[]`
`getDetailMessageArguments(org.springframework.context.MessageSource source, Locale locale)`
Variant of `ErrorResponse.getDetailMessageArguments()` that uses the given `MessageSource` for resolving the message argument values.
`int`
`getErrorCount()`
`org.springframework.validation.FieldError`
`getFieldError()`
`org.springframework.validation.FieldError`
`getFieldError(String field)`
`int`
`getFieldErrorCount()`
`int`
`getFieldErrorCount(String field)`
`List<org.springframework.validation.FieldError>`
`getFieldErrors()`
`List<org.springframework.validation.FieldError>`
`getFieldErrors(String field)`
`Class<?>`
`getFieldType(String field)`
`Object`
`getFieldValue(String field)`
`org.springframework.validation.ObjectError`
`getGlobalError()`
`int`
`getGlobalErrorCount()`
`List<org.springframework.validation.ObjectError>`
`getGlobalErrors()`
`String`
`getMessage()`
Returns diagnostic information about the errors held in this object.
`Map<String,Object>`
`getModel()`
`String`
`getNestedPath()`
`String`
`getObjectName()`
`org.springframework.beans.PropertyEditorRegistry`
`getPropertyEditorRegistry()`
`Object`
`getRawFieldValue(String field)`
`String[]`
`getSuppressedFields()`
`Object`
`getTarget()`
`boolean`
`hasErrors()`
`boolean`
`hasFieldErrors()`
`boolean`
`hasFieldErrors(String field)`
`boolean`
`hasGlobalErrors()`
`int`
`hashCode()`
`void`
`popNestedPath()`
`void`
`pushNestedPath(String subPath)`
`void`
`recordFieldValue(String field, Class<?> type, Object value)`
`void`
`recordSuppressedField(String field)`
`void`
`reject(String errorCode)`
`void`
`reject(String errorCode, Object[] errorArgs, String defaultMessage)`
`void`
`reject(String errorCode, String defaultMessage)`
`void`
`rejectValue(String field, String errorCode)`
`void`
`rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage)`
`void`
`rejectValue(String field, String errorCode, String defaultMessage)`
`String[]`
`resolveMessageCodes(String errorCode)`
`String[]`
`resolveMessageCodes(String errorCode, String field)`
`void`
`setNestedPath(String nestedPath)`

### Methods inherited from class org.springframework.web.server.ServerWebInputException

`getMethodParameter`

### Methods inherited from class org.springframework.web.server.ResponseStatusException

`getHeaders, getReason, getResponseHeaders, updateAndGetBody`

### Methods inherited from class org.springframework.web.ErrorResponseException

`getBody, getDetailMessageCode, getStatusCode, setDetail, setInstance, setTitle, setType`

### Methods inherited from class org.springframework.core.NestedRuntimeException

`contains, getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.web.ErrorResponse

`getTitleMessageCode, getTypeMessageCode`

### Methods inherited from interface org.springframework.validation.Errors

`failOnError, toString`

## Constructor Details

### WebExchangeBindException

public WebExchangeBindException(org.springframework.core.MethodParameter parameter, org.springframework.validation.BindingResult bindingResult)

## Method Details

### getBindingResult

public final org.springframework.validation.BindingResult getBindingResult()
Return the BindingResult that this BindException wraps.

Will typically be a BeanPropertyBindingResult.

See Also:
  - `BeanPropertyBindingResult`

### getDetailMessageArguments

public Object[] getDetailMessageArguments()
Description copied from interface: `ErrorResponse`
Return arguments to use along with a `message code` to resolve the problem "detail" for this exception through a `MessageSource`. The arguments are expanded into placeholders of the message value, for example, "Invalid content type {0}".

Specified by:
  `getDetailMessageArguments` in interface `ErrorResponse`
Overrides:
  `getDetailMessageArguments` in class `ErrorResponseException`

### getDetailMessageArguments

public Object[] getDetailMessageArguments(org.springframework.context.MessageSource source, Locale locale)
Description copied from interface: `ErrorResponse`
Variant of `ErrorResponse.getDetailMessageArguments()` that uses the given `MessageSource` for resolving the message argument values.

This is useful for example to expand message codes from validation errors.

The default implementation delegates to `ErrorResponse.getDetailMessageArguments()`, ignoring the supplied `MessageSource` and `Locale`.

Specified by:
  `getDetailMessageArguments` in interface `ErrorResponse`
Parameters:
  `source` - the `MessageSource` to use for the lookup
  `locale` - the `Locale` to use for the lookup

### getObjectName

public String getObjectName()

Specified by:
  `getObjectName` in interface `org.springframework.validation.Errors`

### setNestedPath

public void setNestedPath(String nestedPath)

Specified by:
  `setNestedPath` in interface `org.springframework.validation.Errors`

### getNestedPath

public String getNestedPath()

Specified by:
  `getNestedPath` in interface `org.springframework.validation.Errors`

### pushNestedPath

public void pushNestedPath(String subPath)

Specified by:
  `pushNestedPath` in interface `org.springframework.validation.Errors`

### popNestedPath

public void popNestedPath() throws IllegalStateException

Specified by:
  `popNestedPath` in interface `org.springframework.validation.Errors`
Throws:
  `IllegalStateException`

### reject

public void reject(String errorCode)

Specified by:
  `reject` in interface `org.springframework.validation.Errors`

### reject

public void reject(String errorCode, String defaultMessage)

Specified by:
  `reject` in interface `org.springframework.validation.Errors`

### reject

public void reject(String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage)

Specified by:
  `reject` in interface `org.springframework.validation.Errors`

### rejectValue

public void rejectValue(@Nullable String field, String errorCode)

Specified by:
  `rejectValue` in interface `org.springframework.validation.Errors`

### rejectValue

public void rejectValue(@Nullable String field, String errorCode, String defaultMessage)

Specified by:
  `rejectValue` in interface `org.springframework.validation.Errors`

### rejectValue

public void rejectValue(@Nullable String field, String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage)

Specified by:
  `rejectValue` in interface `org.springframework.validation.Errors`

### addAllErrors

public void addAllErrors(org.springframework.validation.Errors errors)

Specified by:
  `addAllErrors` in interface `org.springframework.validation.Errors`

### hasErrors

public boolean hasErrors()

Specified by:
  `hasErrors` in interface `org.springframework.validation.Errors`

### getErrorCount

public int getErrorCount()

Specified by:
  `getErrorCount` in interface `org.springframework.validation.Errors`

### getAllErrors

public List<org.springframework.validation.ObjectError> getAllErrors()

Specified by:
  `getAllErrors` in interface `org.springframework.validation.Errors`

### hasGlobalErrors

public boolean hasGlobalErrors()

Specified by:
  `hasGlobalErrors` in interface `org.springframework.validation.Errors`

### getGlobalErrorCount

public int getGlobalErrorCount()

Specified by:
  `getGlobalErrorCount` in interface `org.springframework.validation.Errors`

### getGlobalErrors

public List<org.springframework.validation.ObjectError> getGlobalErrors()

Specified by:
  `getGlobalErrors` in interface `org.springframework.validation.Errors`

### getGlobalError

@Nullable public org.springframework.validation.ObjectError getGlobalError()

Specified by:
  `getGlobalError` in interface `org.springframework.validation.Errors`

### hasFieldErrors

public boolean hasFieldErrors()

Specified by:
  `hasFieldErrors` in interface `org.springframework.validation.Errors`

### getFieldErrorCount

public int getFieldErrorCount()

Specified by:
  `getFieldErrorCount` in interface `org.springframework.validation.Errors`

### getFieldErrors

public List<org.springframework.validation.FieldError> getFieldErrors()

Specified by:
  `getFieldErrors` in interface `org.springframework.validation.Errors`

### getFieldError

@Nullable public org.springframework.validation.FieldError getFieldError()

Specified by:
  `getFieldError` in interface `org.springframework.validation.Errors`

### hasFieldErrors

public boolean hasFieldErrors(String field)

Specified by:
  `hasFieldErrors` in interface `org.springframework.validation.Errors`

### getFieldErrorCount

public int getFieldErrorCount(String field)

Specified by:
  `getFieldErrorCount` in interface `org.springframework.validation.Errors`

### getFieldErrors

public List<org.springframework.validation.FieldError> getFieldErrors(String field)

Specified by:
  `getFieldErrors` in interface `org.springframework.validation.Errors`

### getFieldError

@Nullable public org.springframework.validation.FieldError getFieldError(String field)

Specified by:
  `getFieldError` in interface `org.springframework.validation.Errors`

### getFieldValue

@Nullable public Object getFieldValue(String field)

Specified by:
  `getFieldValue` in interface `org.springframework.validation.Errors`

### getFieldType

@Nullable public Class<?> getFieldType(String field)

Specified by:
  `getFieldType` in interface `org.springframework.validation.Errors`

### getTarget

@Nullable public Object getTarget()

Specified by:
  `getTarget` in interface `org.springframework.validation.BindingResult`

### getModel

public Map<String,Object> getModel()

Specified by:
  `getModel` in interface `org.springframework.validation.BindingResult`

### getRawFieldValue

@Nullable public Object getRawFieldValue(String field)

Specified by:
  `getRawFieldValue` in interface `org.springframework.validation.BindingResult`

### findEditor

@Nullable public PropertyEditor findEditor(@Nullable String field, @Nullable Class valueType)

Specified by:
  `findEditor` in interface `org.springframework.validation.BindingResult`

### getPropertyEditorRegistry

@Nullable public org.springframework.beans.PropertyEditorRegistry getPropertyEditorRegistry()

Specified by:
  `getPropertyEditorRegistry` in interface `org.springframework.validation.BindingResult`

### resolveMessageCodes

public String[] resolveMessageCodes(String errorCode)

Specified by:
  `resolveMessageCodes` in interface `org.springframework.validation.BindingResult`

### resolveMessageCodes

public String[] resolveMessageCodes(String errorCode, String field)

Specified by:
  `resolveMessageCodes` in interface `org.springframework.validation.BindingResult`

### addError

public void addError(org.springframework.validation.ObjectError error)

Specified by:
  `addError` in interface `org.springframework.validation.BindingResult`

### recordFieldValue

public void recordFieldValue(String field, Class<?> type, @Nullable Object value)

Specified by:
  `recordFieldValue` in interface `org.springframework.validation.BindingResult`

### recordSuppressedField

public void recordSuppressedField(String field)

Specified by:
  `recordSuppressedField` in interface `org.springframework.validation.BindingResult`

### getSuppressedFields

public String[] getSuppressedFields()

Specified by:
  `getSuppressedFields` in interface `org.springframework.validation.BindingResult`

### getMessage

public String getMessage()
Returns diagnostic information about the errors held in this object.

Overrides:
  `getMessage` in class `ResponseStatusException`

### equals

public boolean equals(@Nullable Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`