org.springframework.validation
Class ObjectError

java.lang.Object
  extended by org.springframework.context.support.DefaultMessageSourceResolvable
      extended by org.springframework.validation.ObjectError
All Implemented Interfaces:
java.io.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 DefaultMessageCodesResolver javadoc for details on how a message code list is built for an ObjectError.

Since:
10.03.2003
Author:
Juergen Hoeller
See Also:
FieldError, DefaultMessageCodesResolver, Serialized Form

Field Summary
private  java.lang.String objectName
           
 
Constructor Summary
ObjectError(java.lang.String objectName, java.lang.String defaultMessage)
          Create a new instance of the ObjectError class.
ObjectError(java.lang.String objectName, java.lang.String[] codes, java.lang.Object[] arguments, java.lang.String defaultMessage)
          Create a new instance of the ObjectError class.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getObjectName()
          Return the name of the affected object.
 int hashCode()
           
 java.lang.String toString()
          Default implementation exposes the attributes of this MessageSourceResolvable.
 
Methods inherited from class org.springframework.context.support.DefaultMessageSourceResolvable
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

objectName

private final java.lang.String objectName
Constructor Detail

ObjectError

public ObjectError(java.lang.String objectName,
                   java.lang.String defaultMessage)
Create a new instance of the ObjectError class.

Parameters:
objectName - the name of the affected object
defaultMessage - the default message to be used to resolve this message

ObjectError

public ObjectError(java.lang.String objectName,
                   java.lang.String[] codes,
                   java.lang.Object[] arguments,
                   java.lang.String defaultMessage)
Create a new instance of the ObjectError class.

Parameters:
objectName - the name of the affected object
codes - the codes to be used to resolve this message
arguments - the array of arguments to be used to resolve this message
defaultMessage - the default message to be used to resolve this message
Method Detail

getObjectName

public java.lang.String getObjectName()
Return the name of the affected object.


toString

public java.lang.String toString()
Description copied from class: DefaultMessageSourceResolvable
Default implementation exposes the attributes of this MessageSourceResolvable. To be overridden in more specific subclasses, potentially including the resolvable content through resolvableToString().

Overrides:
toString in class DefaultMessageSourceResolvable
See Also:
DefaultMessageSourceResolvable.resolvableToString()

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class DefaultMessageSourceResolvable

hashCode

public int hashCode()
Overrides:
hashCode in class DefaultMessageSourceResolvable