public class ExtensibleException
extends java.lang.Exception
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.io.Serializable> |
data |
protected java.util.Map<java.lang.String,java.io.Serializable> |
readOnlyData |
private static long |
serialVersionUID |
protected java.lang.String |
updatedMessage |
Constructor and Description |
---|
ExtensibleException() |
ExtensibleException(java.lang.String message) |
ExtensibleException(java.lang.String message,
java.lang.Throwable cause) |
ExtensibleException(java.lang.Throwable cause) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.io.Serializable> |
getData() |
java.io.Serializable |
getData(java.lang.String key)
Returns the value stored in the data table for the specified key if it exists, or null otherwise.
|
java.io.Serializable |
getData(java.lang.String key,
java.io.Serializable defaultValue)
Returns the value stored in the data table for the specified key if it exists, or defaultValue otherwise.
|
java.lang.String |
getMessage()
If a new message has been stored (using
setMessage ) this will return
the new message. |
java.lang.String |
getOriginalMessage()
This returns the original message passed in the constructor (to Throwable).
|
ExtensibleException |
putData(java.lang.String key,
java.io.Serializable value) |
ExtensibleException |
putData(java.lang.String key,
java.io.Serializable value,
boolean overwrite) |
void |
resetMessage()
If a new message has been stored (using
setMessage ) this will
revert the message back to the original (passed in the constructor.) |
void |
setMessage(java.lang.String value)
Allows the calling code to update the message stored in this exception.
|
protected java.util.HashMap<java.lang.String,java.io.Serializable> data
protected java.util.Map<java.lang.String,java.io.Serializable> readOnlyData
private static final long serialVersionUID
protected java.lang.String updatedMessage
public ExtensibleException()
public ExtensibleException(java.lang.String message)
public ExtensibleException(java.lang.String message, java.lang.Throwable cause)
public ExtensibleException(java.lang.Throwable cause)
public java.util.Map<java.lang.String,java.io.Serializable> getData()
public java.io.Serializable getData(java.lang.String key)
public java.io.Serializable getData(java.lang.String key, java.io.Serializable defaultValue)
public java.lang.String getMessage()
setMessage
) this will return
the new message. Otherwise, the result is the same as calling Throwable.getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String getOriginalMessage()
setMessage
has been used
to store an updated message.public ExtensibleException putData(java.lang.String key, java.io.Serializable value)
public ExtensibleException putData(java.lang.String key, java.io.Serializable value, boolean overwrite)
public void resetMessage()
setMessage
) this will
revert the message back to the original (passed in the constructor.)public void setMessage(java.lang.String value)
value
- The new message.