类 ObjectError
- 所有已实现的接口:
MessageSourceResolvable,Serializable
- 直接已知子类:
FieldError
See the DefaultMessageCodesResolver javadoc for details on
how a message code list is built for an ObjectError.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器构造器说明ObjectError(String objectName, String defaultMessage) Create a new instance of the ObjectError class.ObjectError(String objectName, String[] codes, Object[] arguments, String defaultMessage) Create a new instance of the ObjectError class. -
方法概要
修饰符和类型方法说明booleanCheck the source behind this error: possibly anException(typicallyPropertyAccessException) or a Bean ValidationConstraintViolation.booleanReturn the name of the affected object.inthashCode()toString()The default implementation exposes the attributes of this MessageSourceResolvable.<T> TUnwrap the source behind this error: possibly anException(typicallyPropertyAccessException) or a Bean ValidationConstraintViolation.voidPreserve the source behind this error: possibly anException(typicallyPropertyAccessException) or a Bean ValidationConstraintViolation.从类继承的方法 cn.taketoday.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString, shouldRenderDefaultMessage
-
构造器详细资料
-
ObjectError
Create a new instance of the ObjectError class.- 参数:
objectName- the name of the affected objectdefaultMessage- the default message to be used to resolve this message
-
ObjectError
public ObjectError(String objectName, @Nullable String[] codes, @Nullable Object[] arguments, @Nullable String defaultMessage) Create a new instance of the ObjectError class.- 参数:
objectName- the name of the affected objectcodes- 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
-
-
方法详细资料
-
getObjectName
Return the name of the affected object. -
wrap
Preserve the source behind this error: possibly anException(typicallyPropertyAccessException) or a Bean ValidationConstraintViolation.Note that any such source object is being stored as transient: that is, it won't be part of a serialized error representation.
- 参数:
source- the source object
-
unwrap
Unwrap the source behind this error: possibly anException(typicallyPropertyAccessException) or a Bean ValidationConstraintViolation.The cause of the outermost exception will be introspected as well, e.g. the underlying conversion exception or exception thrown from a setter (instead of having to unwrap the
PropertyAccessExceptionin turn).- 返回:
- the source object of the given type
- 抛出:
IllegalArgumentException- if no such source object is available (i.e. none specified or not available anymore after deserialization)
-
contains
Check the source behind this error: possibly anException(typicallyPropertyAccessException) or a Bean ValidationConstraintViolation.The cause of the outermost exception will be introspected as well, e.g. the underlying conversion exception or exception thrown from a setter (instead of having to unwrap the
PropertyAccessExceptionin turn).- 返回:
- whether this error has been caused by a source object of the given type
-
equals
- 覆盖:
equals在类中DefaultMessageSourceResolvable
-
hashCode
public int hashCode() -
toString
从类复制的说明:DefaultMessageSourceResolvableThe default implementation exposes the attributes of this MessageSourceResolvable.To be overridden in more specific subclasses, potentially including the resolvable content through
resolvableToString().
-