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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ErrorResponse
ErrorResponse.Builder, ErrorResponse.Interceptor -
Field Summary
Fields inherited from interface org.springframework.validation.BindingResult
MODEL_KEY_PREFIXFields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionWebExchangeBindException(org.springframework.core.MethodParameter parameter, org.springframework.validation.BindingResult bindingResult) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllErrors(org.springframework.validation.Errors errors) voidaddError(org.springframework.validation.ObjectError error) booleanfindEditor(@Nullable String field, @Nullable Class valueType) List<org.springframework.validation.ObjectError> final org.springframework.validation.BindingResultReturn the BindingResult that this BindException wraps.Object[]Return arguments to use along with amessage codeto resolve the problem "detail" for this exception through aMessageSource.Object[]getDetailMessageArguments(org.springframework.context.MessageSource source, Locale locale) Variant ofErrorResponse.getDetailMessageArguments()that uses the givenMessageSourcefor resolving the message argument values.int@Nullable org.springframework.validation.FieldError@Nullable org.springframework.validation.FieldErrorgetFieldError(String field) intintgetFieldErrorCount(String field) List<org.springframework.validation.FieldError> List<org.springframework.validation.FieldError> getFieldErrors(String field) getFieldType(String field) getFieldValue(String field) @Nullable org.springframework.validation.ObjectErrorintList<org.springframework.validation.ObjectError> Returns diagnostic information about the errors held in this object.getModel()@Nullable org.springframework.beans.PropertyEditorRegistrygetRawFieldValue(String field) String[]booleanbooleanbooleanhasFieldErrors(String field) booleaninthashCode()voidvoidpushNestedPath(String subPath) voidrecordFieldValue(String field, Class<?> type, @Nullable Object value) voidrecordSuppressedField(String field) voidvoidvoidvoidrejectValue(@Nullable String field, String errorCode) voidrejectValue(@Nullable String field, String errorCode, Object @Nullable [] errorArgs, @Nullable String defaultMessage) voidrejectValue(@Nullable String field, String errorCode, String defaultMessage) String[]resolveMessageCodes(String errorCode) String[]resolveMessageCodes(String errorCode, String field) voidsetNestedPath(String nestedPath) Methods inherited from class ServerWebInputException
getMethodParameterMethods inherited from class ResponseStatusException
getHeaders, getReason, updateAndGetBodyMethods inherited from class ErrorResponseException
getBody, getDetailMessageCode, getStatusCode, setDetail, setInstance, setTitle, setTypeMethods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCauseMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from interface ErrorResponse
getTitleMessageCode, getTypeMessageCodeMethods 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:
-
getDetailMessageArguments
Description copied from interface:ErrorResponseReturn arguments to use along with amessage codeto resolve the problem "detail" for this exception through aMessageSource. The arguments are expanded into placeholders of the message value, for example, "Invalid content type {0}".- Specified by:
getDetailMessageArgumentsin interfaceErrorResponse- Overrides:
getDetailMessageArgumentsin classErrorResponseException
-
getDetailMessageArguments
public Object[] getDetailMessageArguments(org.springframework.context.MessageSource source, Locale locale) Description copied from interface:ErrorResponseVariant ofErrorResponse.getDetailMessageArguments()that uses the givenMessageSourcefor 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 suppliedMessageSourceandLocale.- Specified by:
getDetailMessageArgumentsin interfaceErrorResponse- Parameters:
source- theMessageSourceto use for the lookuplocale- theLocaleto use for the lookup
-
getObjectName
- Specified by:
getObjectNamein interfaceorg.springframework.validation.Errors
-
setNestedPath
- Specified by:
setNestedPathin interfaceorg.springframework.validation.Errors
-
getNestedPath
- Specified by:
getNestedPathin interfaceorg.springframework.validation.Errors
-
pushNestedPath
- Specified by:
pushNestedPathin interfaceorg.springframework.validation.Errors
-
popNestedPath
- Specified by:
popNestedPathin interfaceorg.springframework.validation.Errors- Throws:
IllegalStateException
-
reject
- Specified by:
rejectin interfaceorg.springframework.validation.Errors
-
reject
-
reject
-
rejectValue
-
rejectValue
-
rejectValue
-
addAllErrors
public void addAllErrors(org.springframework.validation.Errors errors) - Specified by:
addAllErrorsin interfaceorg.springframework.validation.Errors
-
hasErrors
public boolean hasErrors()- Specified by:
hasErrorsin interfaceorg.springframework.validation.Errors
-
getErrorCount
public int getErrorCount()- Specified by:
getErrorCountin interfaceorg.springframework.validation.Errors
-
getAllErrors
- Specified by:
getAllErrorsin interfaceorg.springframework.validation.Errors
-
hasGlobalErrors
public boolean hasGlobalErrors()- Specified by:
hasGlobalErrorsin interfaceorg.springframework.validation.Errors
-
getGlobalErrorCount
public int getGlobalErrorCount()- Specified by:
getGlobalErrorCountin interfaceorg.springframework.validation.Errors
-
getGlobalErrors
- Specified by:
getGlobalErrorsin interfaceorg.springframework.validation.Errors
-
getGlobalError
- Specified by:
getGlobalErrorin interfaceorg.springframework.validation.Errors
-
hasFieldErrors
public boolean hasFieldErrors()- Specified by:
hasFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldErrorCount
public int getFieldErrorCount()- Specified by:
getFieldErrorCountin interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldError
- Specified by:
getFieldErrorin interfaceorg.springframework.validation.Errors
-
hasFieldErrors
- Specified by:
hasFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldErrorCount
- Specified by:
getFieldErrorCountin interfaceorg.springframework.validation.Errors
-
getFieldErrors
-
getFieldError
-
getFieldValue
-
getFieldType
-
getTarget
-
getModel
-
getRawFieldValue
-
findEditor
-
getPropertyEditorRegistry
- Specified by:
getPropertyEditorRegistryin interfaceorg.springframework.validation.BindingResult
-
resolveMessageCodes
-
resolveMessageCodes
-
addError
public void addError(org.springframework.validation.ObjectError error) - Specified by:
addErrorin interfaceorg.springframework.validation.BindingResult
-
recordFieldValue
-
recordSuppressedField
- Specified by:
recordSuppressedFieldin interfaceorg.springframework.validation.BindingResult
-
getSuppressedFields
- Specified by:
getSuppressedFieldsin interfaceorg.springframework.validation.BindingResult
-
getMessage
Returns diagnostic information about the errors held in this object.- Overrides:
getMessagein classResponseStatusException
-
equals
-
hashCode
-