public abstract class AbstractSystemException
extends java.lang.RuntimeException
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EMPTY_MSG
Constant representing an empty message.
|
Constructor and Description |
---|
AbstractSystemException()
Creates the SystemException with the generic error.
|
AbstractSystemException(java.lang.String astrMessage)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessageKey,
java.lang.Object[] aParams,
java.lang.String astrClassName,
java.lang.String astrMethodName)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessageKey,
java.lang.Object[] aParams,
java.lang.String aResourceBundle,
java.lang.String astrClassName,
java.lang.String astrMethodName,
java.lang.Throwable aCause)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessageKey,
java.lang.Object[] aParams,
java.lang.String astrClassName,
java.lang.String astrMethodName,
java.lang.Throwable aCause)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessageKey,
java.lang.String astrLocalizedMessage,
java.lang.Object[] aParams,
java.lang.String astrErrorCode,
java.lang.String aResourceBundle,
java.lang.String astrClassName,
java.lang.String astrMethodName,
java.lang.Throwable aCause)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessageKey,
java.lang.String astrLocalizedMessage,
java.lang.Object[] aParams,
java.lang.String aResourceBundle,
java.lang.String astrClassName,
java.lang.String astrMethodName,
java.lang.Throwable aCause)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessage,
java.lang.String astrClassName,
java.lang.String astrMethodName)
Creates the SystemException.
|
AbstractSystemException(java.lang.String astrMessage,
java.lang.String astrClassName,
java.lang.String astrMethodName,
java.lang.Throwable aCause)
Creates the SystemException.
|
AbstractSystemException(java.lang.Throwable aCause)
Creates the SystemException with the generic error.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCorrelationId()
Gets the correlation Id for this exception
When a system exception is
thrown, the message will be transformed to a more generic message
for the response to the client.
|
java.lang.String |
getErrorCode()
Returns the error code of the exception
|
java.lang.String |
getLocalizedMessage()
Creates a localized description of this
Throwable . |
java.lang.String |
getLocalizedMessage(java.util.Locale aLocale)
Gets the exception message localized to a different locale.
|
java.lang.String |
getMessage()
Returns the error message string of this throwable object.
|
java.lang.String |
getMessageKey()
Returns the message key.
|
java.lang.Object[] |
getMessageParams()
Returns the message parameters.
|
boolean |
isClient()
This method returns whether the system exception is a result of client input or is generated
by some server exception.
|
void |
setClient(boolean isClientException)
This method sets whether the exception was caused as a result of input from the client request
or it is because of a server issue.
|
public static final java.lang.String EMPTY_MSG
public AbstractSystemException()
public AbstractSystemException(java.lang.Throwable aCause)
aCause
- The cause of the exception.public AbstractSystemException(java.lang.String astrMessage)
astrMessage
- The message or message key of the exception.public AbstractSystemException(java.lang.String astrMessage, java.lang.String astrClassName, java.lang.String astrMethodName)
astrMessage
- The message or message key of the exception.astrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.public AbstractSystemException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String astrClassName, java.lang.String astrMethodName)
astrMessageKey
- The message key of the exception.aParams
- The parameters used for the message key of the exception.astrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.public AbstractSystemException(java.lang.String astrMessage, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
astrMessage
- The message key of the exception.astrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.aCause
- The cause of the exception.public AbstractSystemException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
astrMessageKey
- The message key of the exception.aParams
- The parameters used for the message key of the exception.astrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.aCause
- The cause of the exception.public AbstractSystemException(java.lang.String astrMessageKey, java.lang.Object[] aParams, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
astrMessageKey
- The message key of the exception.aParams
- The parameters used for the message key of the exception.aResourceBundle
- The resource bundle associated with the message keyastrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.aCause
- The cause of the exception.public AbstractSystemException(java.lang.String astrMessageKey, java.lang.String astrLocalizedMessage, java.lang.Object[] aParams, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
astrMessageKey
- The message key of the exception.astrLocalizedMessage
- The localized message of the exception.aParams
- The parameters used for the message key of the exception.aResourceBundle
- The resource bundle associated with the message keyastrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.aCause
- The cause of the exception.public AbstractSystemException(java.lang.String astrMessageKey, java.lang.String astrLocalizedMessage, java.lang.Object[] aParams, java.lang.String astrErrorCode, java.lang.String aResourceBundle, java.lang.String astrClassName, java.lang.String astrMethodName, java.lang.Throwable aCause)
astrMessageKey
- The message key of the exception.astrLocalizedMessage
- The localized message of the exception.aParams
- The parameters used for the message key of the exception.astrErrorCode
- The error code of the exception.aResourceBundle
- The resource bundle associated with the message keyastrClassName
- The name of the class throwing the exception.astrMethodName
- The name of the method throwing the exception.aCause
- The cause of the exception.public java.lang.String getLocalizedMessage()
Throwable
.
Subclasses may override this method in order to produce a locale-specific
message. For subclasses that do not override this method, the default
implementation returns the same result as getMessage()
.getLocalizedMessage
in class java.lang.Throwable
public java.lang.String getLocalizedMessage(java.util.Locale aLocale)
aLocale
- The locale for which the message should be returnedpublic java.lang.String getMessage()
getMessage
in class java.lang.Throwable
Throwable
object
if it was created with an error message string; or the message
key if the resource bundle for the default locale cannot be found.
Null
is returned if the exception was created with no error message key.public java.lang.String getErrorCode()
public java.lang.String getMessageKey()
public java.lang.Object[] getMessageParams()
public java.lang.String getCorrelationId()
public boolean isClient()
setClient()
.public void setClient(boolean isClientException)
true
.isClientException
- Whether the system exception is a result of client input.