类 FieldError
java.lang.Object
cn.taketoday.context.support.DefaultMessageSourceResolvable
cn.taketoday.validation.ObjectError
cn.taketoday.validation.FieldError
- 所有已实现的接口:
MessageSourceResolvable,Serializable
Encapsulates a field error, that is, a reason for rejecting a specific
field value.
See the DefaultMessageCodesResolver javadoc for details on
how a message code list is built for a FieldError.
- 从以下版本开始:
- 4.0
- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleangetField()Return the affected field of the object.Return the rejected field value.inthashCode()booleanReturn whether this error represents a binding failure (like a type mismatch); otherwise it is a validation failure.toString()The default implementation exposes the attributes of this MessageSourceResolvable.从类继承的方法 cn.taketoday.validation.ObjectError
contains, getObjectName, unwrap, wrap从类继承的方法 cn.taketoday.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString, shouldRenderDefaultMessage
-
构造器详细资料
-
FieldError
Create a new FieldError instance.- 参数:
objectName- the name of the affected objectfield- the affected field of the objectdefaultMessage- the default message to be used to resolve this message
-
FieldError
public FieldError(String objectName, String field, @Nullable Object rejectedValue, boolean bindingFailure, @Nullable String[] codes, @Nullable Object[] arguments, @Nullable String defaultMessage) Create a new FieldError instance.- 参数:
objectName- the name of the affected objectfield- the affected field of the objectrejectedValue- the rejected field valuebindingFailure- whether this error represents a binding failure (like a type mismatch); else, it is a validation failurecodes- the codes to be used to resolve this messagearguments- the array of arguments to be used to resolve this messagedefaultMessage- the default message to be used to resolve this message
-
-
方法详细资料
-
getField
Return the affected field of the object. -
getRejectedValue
Return the rejected field value. -
isBindingFailure
public boolean isBindingFailure()Return whether this error represents a binding failure (like a type mismatch); otherwise it is a validation failure. -
equals
- 覆盖:
equals在类中ObjectError
-
hashCode
public int hashCode()- 覆盖:
hashCode在类中ObjectError
-
toString
从类复制的说明:DefaultMessageSourceResolvableThe default implementation exposes the attributes of this MessageSourceResolvable.To be overridden in more specific subclasses, potentially including the resolvable content through
resolvableToString().
-