public class ApplicationError
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static short |
TYPE_GENERIC_ERROR
The client error type to indicate a generic error.
|
static short |
TYPE_INVALID_PARAMETER_VALUE
The client error type to indicate an invalid parameter value.
|
static short |
TYPE_MALFORMED_REQUEST
The client error type to indicate the request was improperly formed.
|
static short |
TYPE_MISSING_PARAMETER
The client error type to indicate a missing parameter.
|
static short |
TYPE_PARAMETER_VALUE_NOT_NUMERIC
The client error type to indicate the parameter is not a numeric.
|
Constructor and Description |
---|
ApplicationError()
Creates an instance of the client error object.
|
ApplicationError(short type,
java.lang.String errorKey,
java.lang.Object[] errorParameters,
java.lang.String resourceBundleName)
Creates an instance of the client error object.
|
ApplicationError(short type,
java.lang.String errorKey,
java.lang.String localizedMessage,
java.lang.Object[] errorParameters,
java.lang.String resourceBundleName,
java.lang.String errorCode)
Creates an instance of the client error object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorCode()
This method returns the error code
|
java.lang.String |
getErrorKey()
This method returns the error key associated with the client error.
|
java.lang.Object[] |
getErrorParameters()
This method returns the error parameter to be used to help quantify the client error.
|
java.util.Locale |
getLocale()
This method returns the locale used by the
getLocalizedMessage method. |
java.lang.String |
getLocalizedMessage()
This method returns the localized message of the client error.
|
java.lang.String |
getLocalizedMessage(java.util.Locale locale)
This method returns the localized message of the client error.
|
short |
getType()
This method returns the type of the parameter error.
|
void |
setErrorCode(java.lang.String astrErrorCode)
This method sets error code.
|
void |
setErrorKey(java.lang.String errorKey)
This method sets the error key of the client error.
|
void |
setErrorParameters(java.lang.Object[] errorParameters)
This method sets the parameter errors.
|
void |
setLocale(java.util.Locale locale)
This method sets the locale used by the
getLocalizedMessage method. |
void |
setLocalizedMessage(java.lang.String aLocalizedMessage)
This method set the localized message of the client error.
|
void |
setType(short type)
This method sets the type of the client error.
|
java.lang.String |
toString()
This method returns a short description of this error.
|
public static final short TYPE_GENERIC_ERROR
public static final short TYPE_MISSING_PARAMETER
public static final short TYPE_INVALID_PARAMETER_VALUE
public static final short TYPE_PARAMETER_VALUE_NOT_NUMERIC
public static final short TYPE_MALFORMED_REQUEST
public ApplicationError()
public ApplicationError(short type, java.lang.String errorKey, java.lang.Object[] errorParameters, java.lang.String resourceBundleName)
type
- The type of error that is being reported. Refer to the constants
defined in this class.errorKey
- The error key associated with the error.errorParameters
- The error parameters to associated with the key.resourceBundleName
- The name of the resource bundle to find the key.public ApplicationError(short type, java.lang.String errorKey, java.lang.String localizedMessage, java.lang.Object[] errorParameters, java.lang.String resourceBundleName, java.lang.String errorCode)
type
- The type of error that is being reported. Refer to the constants
defined in this class.errorKey
- The error key associated with the error.localizedMessage
- The localized error message associated with the error.errorParameters
- The error parameters to associated with the key.resourceBundleName
- The name of the resource bundle to find the key.errorCode
- The error code to associated with the key.public short getType()
public void setType(short type)
type
- The type of the client error.public java.lang.String getErrorKey()
public void setErrorKey(java.lang.String errorKey)
errorKey
- The error key.public java.lang.Object[] getErrorParameters()
public void setErrorParameters(java.lang.Object[] errorParameters)
errorParameters
- The error parameters.public java.util.Locale getLocale()
getLocalizedMessage
method.public void setLocale(java.util.Locale locale)
getLocalizedMessage
method.locale
- The locale.public void setLocalizedMessage(java.lang.String aLocalizedMessage)
aLocalizedMessage
- The localized error messagepublic java.lang.String getLocalizedMessage()
public java.lang.String getLocalizedMessage(java.util.Locale locale)
locale
- The locale of the message to return.public java.lang.String getErrorCode()
public void setErrorCode(java.lang.String astrErrorCode)
astrErrorCode
- The Error Code of the exception.public java.lang.String toString()
ApplicationError
object was created with a non-null detailed
message string, then the result is the concatenation of three strings:
getLocalizedMessage()
method for this object
ApplicationError
object was created with a null
detailed message string, then the name of the actual class of this object
is returned.toString
in class java.lang.Object