Package org.springframework.validation
Class ObjectError
- java.lang.Object
- org.springframework.context.support.DefaultMessageSourceResolvable
- org.springframework.validation.ObjectError
- All Implemented Interfaces:
Serializable,MessageSourceResolvable
- Direct Known Subclasses:
FieldError
public class ObjectError extends DefaultMessageSourceResolvable
Encapsulates an object error, that is, a global reason for rejecting an object.See the
DefaultMessageCodesResolverjavadoc for details on how a message code list is built for anObjectError.- Since:
- 10.03.2003
- Author:
- Juergen Hoeller
- See Also:
FieldError,DefaultMessageCodesResolver, Serialized Form
Constructor Summary
Constructors Constructor Description 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.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)StringgetObjectName()Return the name of the affected object.inthashCode()StringtoString()The default implementation exposes the attributes of this MessageSourceResolvable.Methods inherited from class org.springframework.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString
Constructor Detail
ObjectError
public ObjectError(String objectName, String defaultMessage)
Create a new instance of the ObjectError class.- Parameters:
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.- Parameters:
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
Method Detail
getObjectName
public String getObjectName()
Return the name of the affected object.
equals
public boolean equals(Object other)
- Overrides:
equalsin classDefaultMessageSourceResolvable
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultMessageSourceResolvable
toString
public String toString()
Description copied from class:DefaultMessageSourceResolvableThe default implementation exposes the attributes of this MessageSourceResolvable.To be overridden in more specific subclasses, potentially including the resolvable content through
resolvableToString().- Overrides:
toStringin classDefaultMessageSourceResolvable- See Also:
DefaultMessageSourceResolvable.resolvableToString()