Class MethodArgumentNotValidException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.messaging.MessagingException
org.springframework.messaging.handler.invocation.MethodArgumentResolutionException
org.springframework.messaging.handler.annotation.support.MethodArgumentNotValidException
- All Implemented Interfaces:
- Serializable
Exception to be thrown when a method argument fails validation perhaps as a
result of 
@Valid style validation, or perhaps because it is required.- Since:
- 4.0.1
- Author:
- Brian Clozel, Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionMethodArgumentNotValidException(Message<?> message, MethodParameter parameter) Create a new instance with the invalidMethodParameter.MethodArgumentNotValidException(Message<?> message, MethodParameter parameter, BindingResult bindingResult) Create a new instance with the invalidMethodParameterand aBindingResult.
- 
Method SummaryModifier and TypeMethodDescriptionfinal @Nullable BindingResultReturn the BindingResult if the failure is validation-related, ornullif none.Methods inherited from class MethodArgumentResolutionExceptiongetMethodParameterMethods inherited from class MessagingExceptiongetFailedMessage, toStringMethods inherited from class NestedRuntimeExceptioncontains, getMostSpecificCause, getRootCauseMethods inherited from class ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
- 
Constructor Details- 
MethodArgumentNotValidExceptionCreate a new instance with the invalidMethodParameter.
- 
MethodArgumentNotValidExceptionpublic MethodArgumentNotValidException(Message<?> message, MethodParameter parameter, BindingResult bindingResult) Create a new instance with the invalidMethodParameterand aBindingResult.
 
- 
- 
Method Details- 
getBindingResultReturn the BindingResult if the failure is validation-related, ornullif none.
 
-