Class MethodArgumentNotValidException

All Implemented Interfaces:
Serializable

public class MethodArgumentNotValidException extends MethodArgumentResolutionException
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 Details

    • MethodArgumentNotValidException

      public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter)
      Create a new instance with the invalid MethodParameter.
    • MethodArgumentNotValidException

      public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter, BindingResult bindingResult)
      Create a new instance with the invalid MethodParameter and a BindingResult.
  • Method Details

    • getBindingResult

      @Nullable public final BindingResult getBindingResult()
      Return the BindingResult if the failure is validation-related, or null if none.