public class MethodArgumentNotValidException extends AbstractMethodArgumentResolutionException
@Valid
style validation, or perhaps because it is required.Modifier and Type | Field and Description |
---|---|
private BindingResult |
bindingResult |
Constructor and Description |
---|
MethodArgumentNotValidException(Message<?> message,
MethodParameter parameter)
Create a new instance with the invalid
MethodParameter . |
MethodArgumentNotValidException(Message<?> message,
MethodParameter parameter,
BindingResult bindingResult)
Create a new instance with the invalid
MethodParameter and a
BindingResult . |
Modifier and Type | Method and Description |
---|---|
BindingResult |
getBindingResult()
Return the BindingResult if the failure is validation-related,
or
null if none. |
private static java.lang.String |
getValidationErrorMessage(BindingResult bindingResult) |
getMethodParameter, getMethodParamMessage
getFailedMessage
contains, getMessage, getMostSpecificCause, getRootCause
private final BindingResult bindingResult
public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter)
MethodParameter
.public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter, BindingResult bindingResult)
MethodParameter
and a
BindingResult
.public final BindingResult getBindingResult()
null
if none.private static java.lang.String getValidationErrorMessage(BindingResult bindingResult)