|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.toolforge.karma.core.ErrorCode
Class representing a Karma errorcode. These errorcodes are localized to support different languages. Errorcodes are defined in ranges. Exceptions that are supported by Karma, define these ranges.
Constructor Summary | |
ErrorCode(java.lang.String errorCode)
Creates an error code. |
Method Summary | |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getErrorCodeString()
Gets this instance' error code. |
java.lang.String |
getErrorMessage()
Gets the error message for the current locale. |
java.lang.String |
getErrorMessage(java.util.Locale locale)
Gets a localized error message for the ErrorCode instance. |
int |
hashCode()
|
void |
setMessageArguments(java.lang.Object[] messageArguments)
Assigns message arguments to this error code as per the MessageFormat definition. |
void |
setMessageBundle(java.util.ResourceBundle messageBundle)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ErrorCode(java.lang.String errorCode)
[A-Z]{3}-\d{5}
. Examples are:
MAN-00001
, CMD-10020
.
errorCode
- Method Detail |
public void setMessageBundle(java.util.ResourceBundle messageBundle)
public final void setMessageArguments(java.lang.Object[] messageArguments)
MessageFormat
definition.
messageArguments
- An Object array (currently only String
instances are supported).public java.lang.String getErrorMessage(java.util.Locale locale)
Gets a localized error message for the ErrorCode
instance. Error messages are defined in a
error-messages-<locale>.properties
(e.g. error-messages-NL.properties
). A message
text is identified by a key message.
concatenated with getErrorCodeString()
.
locale
, the default locale Locale.ENGLISH
is
used.
locale
- A locale object (e.g. representing the current locale of the user environment).
getErrorCodeString()
when no message was found for this errorcode or the
resourcebundle could not be found for locale
.public java.lang.String getErrorMessage()
public java.lang.String getErrorCodeString()
public boolean equals(java.lang.Object o)
public int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |