|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception com.taursys.util.ChainedException
A ChainedException is a subclass of Exception which contains a Throwable cause. This allows for the creation of a single linked list of exceptions and their respective causes. The printStackTrace() methods display the trace for this exception and then invoke the method for the cause (which can in turn invoke a trace for its ancestory).
The ChainedException also provides for diagnostic information. This information will be displayed in the stack trace, but not included in the basic message. The diagnostic information is available through the getLocalizedMessage method.
Field Summary | |
protected java.lang.Throwable |
cause
|
protected java.lang.String |
diagnosticInfo
|
protected int |
reason
|
static int |
REASON_INVALID_REASON_CODE
|
static int |
REASON_UNSPECIFIED
|
protected java.lang.String |
userFriendlyMessage
|
Constructor Summary | |
|
ChainedException(int reason)
Creates a ModelException with a reason code. |
|
ChainedException(int reason,
java.lang.String diagnosticInfo)
Creates a ModelException with a reason code and diagnostic information. |
|
ChainedException(int reason,
java.lang.Throwable cause)
Creates a ModelException with a reason code and cause. |
|
ChainedException(int reason,
java.lang.Throwable cause,
java.lang.String diagnosticInfo)
Creates a ModelException with a reason code, cause and diagnostic information. |
protected |
ChainedException(java.lang.String message)
Creates a ChainedException with a message. |
protected |
ChainedException(java.lang.String message,
int reason)
Creates a ChainedException with a message. |
protected |
ChainedException(java.lang.String message,
int reason,
java.lang.Throwable cause)
Creates a ChainedException with a message. |
Method Summary | |
java.lang.Throwable |
getCause()
Accesses the original cause of this ChainedException. |
java.lang.String |
getDiagnosticInfo()
Returns the current diagnostic information. |
static java.lang.String |
getInvalidMessage()
Returns String for given reason code else String for REASON_INVALID_REASON_CODE. |
java.lang.String |
getLocalizedMessage()
Override of superclass method to provide diagnostic information (if exists). |
int |
getReason()
Returns the reason code. |
static java.lang.String |
getReasonMessage(int reason)
Returns String for given reason code else String for REASON_INVALID_REASON_CODE. |
java.lang.String |
getUserFriendlyMessage()
Returns the current userFriendlyMessage. |
static void |
main(java.lang.String[] args)
Main for designing/viewing |
void |
printStackTrace()
Prints this ChainedException and its cause to the standard error stream. |
void |
printStackTrace(java.io.PrintStream printStream)
Prints this ChainedException and its cause to the given print stream. |
void |
printStackTrace(java.io.PrintWriter printWriter)
Prints this ChainedException and its cause to the given print writer. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getMessage, getStackTrace, initCause, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int REASON_INVALID_REASON_CODE
public static final int REASON_UNSPECIFIED
protected java.lang.Throwable cause
protected java.lang.String diagnosticInfo
protected int reason
protected java.lang.String userFriendlyMessage
Constructor Detail |
public ChainedException(int reason)
public ChainedException(int reason, java.lang.Throwable cause)
public ChainedException(int reason, java.lang.Throwable cause, java.lang.String diagnosticInfo)
public ChainedException(int reason, java.lang.String diagnosticInfo)
protected ChainedException(java.lang.String message)
protected ChainedException(java.lang.String message, int reason)
protected ChainedException(java.lang.String message, int reason, java.lang.Throwable cause)
Method Detail |
public static java.lang.String getReasonMessage(int reason)
public static java.lang.String getInvalidMessage()
public int getReason()
public java.lang.Throwable getCause()
public java.lang.String getUserFriendlyMessage()
public java.lang.String getLocalizedMessage()
public java.lang.String getDiagnosticInfo()
public void printStackTrace()
public void printStackTrace(java.io.PrintStream printStream)
public void printStackTrace(java.io.PrintWriter printWriter)
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |