类 ObjectError
- java.lang.Object
- org.springframework.context.support.DefaultMessageSourceResolvable
- org.springframework.validation.ObjectError
- 所有已实现的接口:
Serializable
,MessageSourceResolvable
- 直接已知子类:
FieldError
public class ObjectError extends DefaultMessageSourceResolvable
Encapsulates an object error, that is, a global reason for rejecting an object.See the
DefaultMessageCodesResolver
javadoc for details on how a message code list is built for anObjectError
.- 从以下版本开始:
- 10.03.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
FieldError
,DefaultMessageCodesResolver
, 序列化表格
构造器概要
构造器 构造器 说明 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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(Object other)
String
getObjectName()
Return the name of the affected object.int
hashCode()
String
toString()
The default implementation exposes the attributes of this MessageSourceResolvable.从类继承的方法 org.springframework.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString
构造器详细资料
ObjectError
public ObjectError(String objectName, String defaultMessage)
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, String[] codes, Object[] arguments, 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
public String getObjectName()
Return the name of the affected object.
hashCode
public int hashCode()
toString
public String toString()
从类复制的说明:DefaultMessageSourceResolvable
The default implementation exposes the attributes of this MessageSourceResolvable.To be overridden in more specific subclasses, potentially including the resolvable content through
resolvableToString()
.