org.springframework.messaging.handler.annotation.support

Class MethodArgumentNotValidException

  • All Implemented Interfaces:
    java.io.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:
    Serialized Form
    • Constructor Detail

      • MethodArgumentNotValidException

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

      • getBindingResult

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