@Valid fails.
Extends BindException as of 5.3.
| Modifier and Type | Field and Description |
|---|---|
| private final ProblemDetail | |
| private final MethodParameter |
| Access | Constructor and Description |
|---|---|
| public | MethodArgumentNotValidException(MethodParameter
the parameter that failed validation parameter, BindingResult the results of the validation bindingResult)Constructor for |
| Modifier and Type | Method and Description |
|---|---|
| public static List | errorsToStringList(List<? extends ObjectError> errors)
Deprecated
for removal since 6.1. in favor of using
Convert each given BindErrorUtils and
getAllErrors(), to be removed in 6.2
ObjectError to a String.
|
| public static List | errorsToStringList(List<? extends ObjectError> errors, MessageSource messageSource, Locale locale)
Deprecated
for removal since 6.1. in favor of
Convert each given BindErrorUtils, to be removed in 6.2
ObjectError to a String, and use a
MessageSource to resolve each error.
|
| public ProblemDetail | getBody()
Implements org. ProblemDetail whose status
should match the response status.
|
| public Object[] | getDetailMessageArguments(MessageSource
the source, Locale MessageSource to use for the lookupthe locale)Locale to use for the lookupOverrides default org. getDetailMessageArguments() that uses the given
MessageSource for resolving the message argument values.
|
| public Object[] | getDetailMessageArguments()
Overrides default org. message code to resolve the problem "detail" for this exception
through a MessageSource.
|
| public String | getMessage()
Overrides org. |
| public final MethodParameter | |
| public HttpStatusCode | getStatusCode()
Implements org. |
| public Map | Returns: a Map with errors as keys and resolved messages as values
Deprecated
for removal since 6.1. in favor of using
Resolve global and field errors to messages with the given
BindErrorUtils and
getAllErrors(), to be removed in 6.2
MessageSource and Locale.
|
| body | back to summary |
|---|---|
| private final ProblemDetail body | |
| parameter | back to summary |
|---|---|
| private final MethodParameter parameter | |
| MethodArgumentNotValidException | back to summary |
|---|---|
| public MethodArgumentNotValidException(MethodParameter parameter, BindingResult bindingResult) Constructor for
| |
| errorsToStringList | back to summary |
|---|---|
| public static List Deprecated for removal since 6.1. in favor of using Convert each given
| |
| errorsToStringList | back to summary |
|---|---|
| public static List Convert each given
| |
| getBody | back to summary |
|---|---|
| public ProblemDetail getBody() Implements org. Doc from org. Return the body for the response, formatted as an RFC 7807
| |
| 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
| |
| getDetailMessageArguments | back to summary |
|---|---|
| public Object[] getDetailMessageArguments() Overrides default org. Doc from org. Return arguments to use along with a
| |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides org. Doc from org. Returns diagnostic information about the errors held in this object.
| |
| getParameter | back to summary |
|---|---|
| public final MethodParameter getParameter() Return the method parameter that failed validation. | |
| getStatusCode | back to summary |
|---|---|
| public HttpStatusCode getStatusCode() Implements org. Doc from org. Return the HTTP status code to use for the response.
| |
| 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
| |