org.kuali.rice.krad.util
Class ErrorMessage

java.lang.Object
  extended by org.kuali.rice.krad.util.ErrorMessage
All Implemented Interfaces:
Serializable

public class ErrorMessage
extends Object
implements Serializable

Contains the error message key and parameters for a specific instantiation of an error message

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Constructor Summary
ErrorMessage()
          Default constructor
ErrorMessage(String errorKey, String... messageParameters)
          Convenience constructor which sets both fields
 
Method Summary
 boolean equals(Object obj)
           
 String getComponentCode()
          A code within the namespace that identifies a component or group the error message is associated with
 String getErrorKey()
          Gets the message key for this ErrorMessage
 String[] getMessageParameters()
          Get the messageParameters which should be used when evaluating and generating the message for the ErrorMessage.
 String getMessagePrefixKey()
          Gets the messagePrefixKey which defines the message key for the message to be prefixed to the message defined by errorKey.
 String[] getMessagePrefixParameters()
          Get the messagePrefixParameters which should be used when evaluating and generating the message for the messagePrefixKey.
 String getMessageSuffixKey()
          Gets the messageSuffixKey which defines the message key for the message to be appended to the message defined by errorKey.
 String[] getMessageSuffixParameters()
          Get the messagePrefixParameters which should be used when evaluating and generating the message for the messageSuffixKey.
 String getNamespaceCode()
          Namespace code (often an application or module code) the error message is associated with
 int hashCode()
          Defined because when you redefine equals, you must redefine hashcode.
 void setComponentCode(String componentCode)
          Setter for the error's associated component code
 void setErrorKey(String errorKey)
          Sets the key to use to retrieve the message for this ErrorMessage
 void setMessageParameters(String[] messageParameters)
          Sets the messageParameters for this ErrorMessage
 void setMessagePrefixKey(String messagePrefixKey)
          Set the messagePrefixKey
 void setMessagePrefixParameters(String[] messagePrefixParameters)
          Set the messagePrefixParameters
 void setMessageSuffixKey(String messageSuffixKey)
          Set the messageSuffixKey
 void setMessageSuffixParameters(String[] messageSuffixParameters)
          Set the messageSuffixParameters
 void setNamespaceCode(String namespaceCode)
          Setter for the error's associated namespace code
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorMessage

public ErrorMessage()
Default constructor


ErrorMessage

public ErrorMessage(String errorKey,
                    String... messageParameters)
Convenience constructor which sets both fields

Parameters:
errorKey - - message key for the error
messageParameters - - zero or more parameters for the message text
Method Detail

getNamespaceCode

public String getNamespaceCode()
Namespace code (often an application or module code) the error message is associated with

Used with the component code and error key for retrieving the message text (and prefix, suffix). If null, the default namespace code will be used

Returns:
String error namespace code

setNamespaceCode

public void setNamespaceCode(String namespaceCode)
Setter for the error's associated namespace code

Parameters:
namespaceCode -

getComponentCode

public String getComponentCode()
A code within the namespace that identifies a component or group the error message is associated with

Used with the namespace and error key for retrieving the message text (and prefix, suffix). If null, the default component code will be used

Returns:
String component code

setComponentCode

public void setComponentCode(String componentCode)
Setter for the error's associated component code

Parameters:
componentCode -

setErrorKey

public void setErrorKey(String errorKey)
Sets the key to use to retrieve the message for this ErrorMessage

Parameters:
errorKey -

getErrorKey

public String getErrorKey()
Gets the message key for this ErrorMessage

Returns:
message key

setMessageParameters

public void setMessageParameters(String[] messageParameters)
Sets the messageParameters for this ErrorMessage

Parameters:
messageParameters -

getMessageParameters

public String[] getMessageParameters()
Get the messageParameters which should be used when evaluating and generating the message for the ErrorMessage.

Returns:
the messageParameters

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Defined because when you redefine equals, you must redefine hashcode.

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

getMessagePrefixKey

public String getMessagePrefixKey()
Gets the messagePrefixKey which defines the message key for the message to be prefixed to the message defined by errorKey. It is up to the code using this errorMessage to prepend the prefix message to the original message.

Returns:
the messagePrefixKey

setMessagePrefixKey

public void setMessagePrefixKey(String messagePrefixKey)
Set the messagePrefixKey

Parameters:
messagePrefixKey -

getMessageSuffixKey

public String getMessageSuffixKey()
Gets the messageSuffixKey which defines the message key for the message to be appended to the message defined by errorKey. It is up to the code using this errorMessage to append the suffix message to the original message.

Returns:
the messageSuffixKey

setMessageSuffixKey

public void setMessageSuffixKey(String messageSuffixKey)
Set the messageSuffixKey

Parameters:
messageSuffixKey -

getMessagePrefixParameters

public String[] getMessagePrefixParameters()
Get the messagePrefixParameters which should be used when evaluating and generating the message for the messagePrefixKey.

Returns:
the messagePrefixParameters

setMessagePrefixParameters

public void setMessagePrefixParameters(String[] messagePrefixParameters)
Set the messagePrefixParameters

Parameters:
messagePrefixParameters -

getMessageSuffixParameters

public String[] getMessageSuffixParameters()
Get the messagePrefixParameters which should be used when evaluating and generating the message for the messageSuffixKey.

Returns:
the messageSuffixParameters

setMessageSuffixParameters

public void setMessageSuffixParameters(String[] messageSuffixParameters)
Set the messageSuffixParameters

Parameters:
messageSuffixParameters -


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.