类 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.AbstractMethodArgumentResolutionException
- org.springframework.messaging.handler.annotation.support.MethodArgumentNotValidException
- 所有已实现的接口:
Serializable
public class MethodArgumentNotValidException extends AbstractMethodArgumentResolutionException
Exception to be thrown when a method argument fails validation perhaps as a result of@Valid
style validation, or perhaps because it is required.- 从以下版本开始:
- 4.0.1
- 作者:
- Brian Clozel, Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 MethodArgumentNotValidException(Message<?> message, MethodParameter parameter)
Create a new instance with the invalidMethodParameter
.MethodArgumentNotValidException(Message<?> message, MethodParameter parameter, BindingResult bindingResult)
Create a new instance with the invalidMethodParameter
and aBindingResult
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 BindingResult
getBindingResult()
Return the BindingResult if the failure is validation-related, ornull
if none.从类继承的方法 org.springframework.messaging.handler.annotation.support.AbstractMethodArgumentResolutionException
getMethodParamMessage
从类继承的方法 org.springframework.messaging.handler.invocation.MethodArgumentResolutionException
getMethodParameter
从类继承的方法 org.springframework.messaging.MessagingException
getFailedMessage, toString
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
MethodArgumentNotValidException
public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter)
Create a new instance with the invalidMethodParameter
.
MethodArgumentNotValidException
public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter, BindingResult bindingResult)
Create a new instance with the invalidMethodParameter
and aBindingResult
.
方法详细资料
getBindingResult
public final BindingResult getBindingResult()
Return the BindingResult if the failure is validation-related, ornull
if none.