Class ErrorMessage

java.lang.Object
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:
  • Constructor Details

    • 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 Details

    • 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:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Defined because when you redefine equals, you must redefine hashcode.
      Overrides:
      hashCode in class Object
      See Also:
    • 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 -