Class MethodArgumentNotValidException

  • All Implemented Interfaces:

    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.
    Brian Clozel, Rossen Stoyanchev
    See Also:
    Serialized Form
    • Constructor Detail

      • MethodArgumentNotValidException

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

      • getBindingResult

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