类 MethodArgumentNotValidException
java.lang.Object
java.lang.Throwable
java.lang.Exception
cn.taketoday.validation.BindException
cn.taketoday.web.bind.MethodArgumentNotValidException
- 所有已实现的接口:
HttpStatusCodeProvider,cn.taketoday.validation.BindingResult,cn.taketoday.validation.Errors,ErrorResponse,Serializable
public class MethodArgumentNotValidException
extends cn.taketoday.validation.BindException
implements ErrorResponse
Exception to be thrown when validation on an argument annotated with
@Valid fails.
Extends BindException.- 从以下版本开始:
- 4.0 2022/3/2 16:18
- 作者:
- Rossen Stoyanchev, Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private final ProblemDetailprivate final cn.taketoday.core.MethodParameterprivate static final long从接口继承的字段 cn.taketoday.validation.BindingResult
MODEL_KEY_PREFIX从接口继承的字段 cn.taketoday.validation.Errors
NESTED_PATH_SEPARATOR -
构造器概要
构造器构造器说明MethodArgumentNotValidException(cn.taketoday.core.MethodParameter parameter, cn.taketoday.validation.BindingResult bindingResult) Constructor forMethodArgumentNotValidException. -
方法概要
修饰符和类型方法说明getBody()Return the body for the response, formatted as an RFC 7807ProblemDetailwhosestatusshould match the response status.final cn.taketoday.core.MethodParameterReturn the method parameter that failed validation.Return the HTTP status code to use for the response.从类继承的方法 cn.taketoday.validation.BindException
addAllErrors, addError, equals, findEditor, getAllErrors, getBindingResult, getErrorCount, getFieldError, getFieldError, getFieldErrorCount, getFieldErrorCount, getFieldErrors, getFieldErrors, getFieldType, getFieldValue, getGlobalError, getGlobalErrorCount, getGlobalErrors, getModel, getNestedPath, getObjectName, getPropertyEditorRegistry, getRawFieldValue, getSuppressedFields, getTarget, hasErrors, hasFieldErrors, hasFieldErrors, hasGlobalErrors, hashCode, popNestedPath, pushNestedPath, recordFieldValue, recordSuppressedField, reject, reject, reject, rejectValue, rejectValue, rejectValue, resolveMessageCodes, resolveMessageCodes, setNestedPath从类继承的方法 java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString从接口继承的方法 cn.taketoday.web.ErrorResponse
getHeaders从接口继承的方法 cn.taketoday.validation.Errors
failOnError, toString
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
parameter
private final cn.taketoday.core.MethodParameter parameter -
body
-
-
构造器详细资料
-
MethodArgumentNotValidException
public MethodArgumentNotValidException(cn.taketoday.core.MethodParameter parameter, cn.taketoday.validation.BindingResult bindingResult) Constructor forMethodArgumentNotValidException.- 参数:
parameter- the parameter that failed validationbindingResult- the results of the validation
-
-
方法详细资料
-
getStatusCode
从接口复制的说明:ErrorResponseReturn the HTTP status code to use for the response.- 指定者:
getStatusCode在接口中ErrorResponse- 指定者:
getStatusCode在接口中HttpStatusCodeProvider
-
getBody
从接口复制的说明:ErrorResponseReturn the body for the response, formatted as an RFC 7807ProblemDetailwhosestatusshould match the response status.- 指定者:
getBody在接口中ErrorResponse
-
getParameter
public final cn.taketoday.core.MethodParameter getParameter()Return the method parameter that failed validation. -
getMessage
- 覆盖:
getMessage在类中cn.taketoday.validation.BindException
-