Package org.kuali.rice.krad.util
Class ErrorMessage
java.lang.Object
org.kuali.rice.krad.util.ErrorMessage
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionDefault constructorErrorMessage(String errorKey, String... messageParameters) Convenience constructor which sets both fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanA code within the namespace that identifies a component or group the error message is associated withGets the message key for this ErrorMessageString[]Get the messageParameters which should be used when evaluating and generating the message for the ErrorMessage.Gets the messagePrefixKey which defines the message key for the message to be prefixed to the message defined by errorKey.String[]Get the messagePrefixParameters which should be used when evaluating and generating the message for the messagePrefixKey.Gets the messageSuffixKey which defines the message key for the message to be appended to the message defined by errorKey.String[]Get the messagePrefixParameters which should be used when evaluating and generating the message for the messageSuffixKey.Namespace code (often an application or module code) the error message is associated withinthashCode()Defined because when you redefine equals, you must redefine hashcode.voidsetComponentCode(String componentCode) Setter for the error's associated component codevoidsetErrorKey(String errorKey) Sets the key to use to retrieve the message for this ErrorMessagevoidsetMessageParameters(String[] messageParameters) Sets the messageParameters for this ErrorMessagevoidsetMessagePrefixKey(String messagePrefixKey) Set the messagePrefixKeyvoidsetMessagePrefixParameters(String[] messagePrefixParameters) Set the messagePrefixParametersvoidsetMessageSuffixKey(String messageSuffixKey) Set the messageSuffixKeyvoidsetMessageSuffixParameters(String[] messageSuffixParameters) Set the messageSuffixParametersvoidsetNamespaceCode(String namespaceCode) Setter for the error's associated namespace codetoString()
-
Constructor Details
-
ErrorMessage
public ErrorMessage()Default constructor -
ErrorMessage
Convenience constructor which sets both fields- Parameters:
errorKey- - message key for the errormessageParameters- - zero or more parameters for the message text
-
-
Method Details
-
getNamespaceCode
Namespace code (often an application or module code) the error message is associated withUsed 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
Setter for the error's associated namespace code- Parameters:
namespaceCode-
-
getComponentCode
A code within the namespace that identifies a component or group the error message is associated withUsed 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
Setter for the error's associated component code- Parameters:
componentCode-
-
setErrorKey
Sets the key to use to retrieve the message for this ErrorMessage- Parameters:
errorKey-
-
getErrorKey
Gets the message key for this ErrorMessage- Returns:
- message key
-
setMessageParameters
Sets the messageParameters for this ErrorMessage- Parameters:
messageParameters-
-
getMessageParameters
Get the messageParameters which should be used when evaluating and generating the message for the ErrorMessage.- Returns:
- the messageParameters
-
toString
-
equals
-
hashCode
public int hashCode()Defined because when you redefine equals, you must redefine hashcode. -
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
Set the messagePrefixKey- Parameters:
messagePrefixKey-
-
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
Set the messageSuffixKey- Parameters:
messageSuffixKey-
-
getMessagePrefixParameters
Get the messagePrefixParameters which should be used when evaluating and generating the message for the messagePrefixKey.- Returns:
- the messagePrefixParameters
-
setMessagePrefixParameters
Set the messagePrefixParameters- Parameters:
messagePrefixParameters-
-
getMessageSuffixParameters
Get the messagePrefixParameters which should be used when evaluating and generating the message for the messageSuffixKey.- Returns:
- the messageSuffixParameters
-
setMessageSuffixParameters
Set the messageSuffixParameters- Parameters:
messageSuffixParameters-
-