public abstract class BaseException
extends java.lang.Exception
implements java.io.Serializable
Constructor and Description |
---|
BaseException()
This method creates a new
BaseException object. |
BaseException(java.lang.String resourceBundleName,
java.lang.String messageKey,
java.lang.Object[] formatArguments,
java.lang.String defaultMessage)
This method creates a new
BaseException object. |
BaseException(java.lang.String resourceBundleName,
java.lang.String messageKey,
java.lang.Object[] formatArguments,
java.lang.String defaultMessage,
java.lang.Throwable exception)
This method creates a new
BaseException object. |
BaseException(java.lang.Throwable exception)
This method creates a new
BaseException object. |
Modifier and Type | Method and Description |
---|---|
void |
addProperties(java.util.Map map)
This method adds a map into the properties associated with the exception.
|
void |
addProperties(java.util.Properties properties)
This method adds more properties associated with this exception.
|
void |
addProperty(java.lang.String key,
java.lang.Object value)
This method adds a single property to the exception.
|
java.lang.String |
dumpException()
This method converts this exception into a human-readable string.
|
java.lang.String |
getClassSource()
This method returns the name of the class that created the exception.
|
java.lang.String |
getDefaultMessage()
This method returns the default message associated with this exception.
|
java.lang.Object[] |
getFormatArguments()
This method returns text format arguments for message to be formated and localized.
|
java.lang.String |
getLocalizedMessage()
This method returns a localized message using the default Locale.
|
java.lang.String |
getLocalizedMessage(java.util.Locale locale)
This method returns a localized message.
|
java.lang.String |
getMessage()
This method will invoke
getDefaultMessage() . |
java.lang.String |
getMessageKey()
This method returns the key of the message to be translated.
|
java.lang.String |
getMethodSource()
This method returns the name of the method that created the exception.
|
java.lang.Throwable |
getPreviousException()
This method returns the previous exception that further threw this exception.
|
java.util.Properties |
getProperties()
This method returns the properties associated with the exception.
|
java.lang.String |
getResourceBundleName()
This method returns the name of the resource bundle to be used to translate the error message.
|
void |
setClassSource(java.lang.String classSource)
This method sets the name of the class that created the exception.
|
void |
setDefaultMessage(java.lang.String defaultMessage)
This method sets the default message of this exception
|
void |
setFormatArguments(java.lang.Object[] formatArguments)
This method sets text format arguments for message to be formated and localized.
|
void |
setMessageKey(java.lang.String messageKey)
This method sets the key of the message to be translated.
|
void |
setMethodSource(java.lang.String methodSource)
This method sets the name of the method that created the exception.
|
void |
setPreviousException(java.lang.Throwable localPreviousException)
This method sets the previous exception that further threw this exception.
|
void |
setProperties(java.util.Properties properties)
This method sets the properties associated with the exception.
|
void |
setResourceBundleName(java.lang.String resourceBundleName)
This method sets the name of the resource bundle to be used to translate the message.
|
public BaseException()
BaseException
object.public BaseException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultMessage)
BaseException
object.resourceBundleName
- The name of the resource bundle to be used to translate the messagemessageKey
- The key of the message to be translatedformatArguments
- Parameters to populate the translated messagedefaultMessage
- The default message to be used if translation failspublic BaseException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultMessage, java.lang.Throwable exception)
BaseException
object.resourceBundleName
- The name of the resource bundle to be used to translate the messagemessageKey
- The key of the message to be translatedformatArguments
- Parameters to populate the translated messagedefaultMessage
- The default message to be used if translation failsexception
- The exception to be wrappedpublic BaseException(java.lang.Throwable exception)
BaseException
object.exception
- The exception to be wrappedpublic void setClassSource(java.lang.String classSource)
classSource
- The name of the class that created the exception.public java.lang.String getClassSource()
public java.lang.String getDefaultMessage()
public java.lang.String getMessage()
getDefaultMessage()
.getMessage
in class java.lang.Throwable
getDefaultMessage()
public void setMessageKey(java.lang.String messageKey)
messageKey
- the key of the message to be translatedpublic java.lang.String getMessageKey()
public void setMethodSource(java.lang.String methodSource)
methodSource
- The name of the method that created the exceptionpublic java.lang.String getMethodSource()
public void setPreviousException(java.lang.Throwable localPreviousException)
localPreviousException
- The previous exception to setpublic java.lang.Throwable getPreviousException()
public void setProperties(java.util.Properties properties)
Properties
- the properties associated with the exceptionpublic java.util.Properties getProperties()
public void setResourceBundleName(java.lang.String resourceBundleName)
The
- name of the resource bundle to be used to translate the messagepublic java.lang.String getResourceBundleName()
public void addProperties(java.util.Properties properties)
properties
- more properties to be associated with this exceptionpublic void addProperties(java.util.Map map)
This method adds a map into the properties associated with the exception.
Properties may be overwritten if the incoming properties have the same name.
map
- The map to be added into the properties associated with the exceptionpublic void addProperty(java.lang.String key, java.lang.Object value)
This method adds a single property to the exception.
If a property with the specified key
already exists,
the value is overwritten.
key
- The name of the propertyvalue
- The value of the propertypublic java.lang.String dumpException()
public void setDefaultMessage(java.lang.String defaultMessage)
defaultMessage
- The default message of this exceptionpublic java.lang.String getLocalizedMessage()
defaultMessage
will be returned.getLocalizedMessage
in class java.lang.Throwable
defaultMessage
public java.lang.String getLocalizedMessage(java.util.Locale locale)
defaultMessage
will be returned.The
- target locale; if null
is specified, uses the default LocaledefaultMessage
public java.lang.Object[] getFormatArguments()
public void setFormatArguments(java.lang.Object[] formatArguments)
formatArguments
- The format arguments for the localized/formatted message