|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.keel.core.exception.NestedException
Base exception that allows nesting of other exceptions. Most NestedExceptions will be created using one of the custom constructors. Basically, there are three arguments, each of which is optional, that always appear in the same order: 1: the string message for the exception being created 2: the nested exception (or nested throwable, actually) 3: the exception "key" - for internationalization Any of these can be left out or passed as null, as required in the situation.
| Field Summary | |
private java.lang.StringBuffer |
addedMessages |
private java.lang.StringBuffer |
addedStacktrace |
private java.lang.String |
errorKey |
private java.lang.String |
nestedExceptionType |
| Fields inherited from class java.lang.Exception |
|
| Fields inherited from class java.lang.Throwable |
|
| Constructor Summary | |
NestedException()Default constructor |
|
NestedException(java.lang.String s)Constructor with a single message, no key |
|
NestedException(java.lang.String s, java.lang.String newErrorKey)String message and error key |
|
NestedException(java.lang.String message, java.lang.Throwable newNested)Constructor with a message and a nested exception |
|
NestedException(java.lang.String message, java.lang.Throwable newNested, java.lang.String newErrorKey)Constructor with a single message and a nested exception with error key |
|
NestedException(java.lang.Throwable newNested)Constructor with no message and a nested exception |
|
NestedException(java.lang.Throwable newNested, java.lang.String newErrorKey)Constructor with no message and a nested exception, but with an error key |
|
| Method Summary | |
void |
addToMessage(java.lang.String s) |
void |
addToStack(java.lang.String s)Add a specified string to the stack trace of this exception. |
java.lang.String |
getErrorKey()Return the error key if one was supplied |
java.lang.String |
getMessage()Extend getMessage to return the nested message |
java.lang.String |
getNestedExceptionType() |
java.lang.String |
getStackTraceAsString() |
private java.lang.String |
getStackTraceAsString(java.lang.Throwable t) |
void |
printStackTrace()Extend printStackTrace to handle the nested exception correctly. |
void |
printStackTrace(java.io.PrintStream p)Extend printStackTrace to handle the nested Exception |
void |
printStackTrace(java.io.PrintWriter p)Extend printStackTrace to handle the nested Exception |
private void |
setNested(java.lang.Throwable newNested) |
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.lang.String errorKey
private java.lang.StringBuffer addedStacktrace
private java.lang.StringBuffer addedMessages
private java.lang.String nestedExceptionType
| Constructor Detail |
public NestedException()
public NestedException(java.lang.String s)
s - exception message
public NestedException(java.lang.String s,
java.lang.String newErrorKey)
public NestedException(java.lang.String message,
java.lang.Throwable newNested)
newNested - The nested item
public NestedException(java.lang.String message,
java.lang.Throwable newNested,
java.lang.String newErrorKey)
newNested - The nested itempublic NestedException(java.lang.Throwable newNested)
newNested - The nested exception
public NestedException(java.lang.Throwable newNested,
java.lang.String newErrorKey)
newNested - The nested exception| Method Detail |
public void addToMessage(java.lang.String s)
private void setNested(java.lang.Throwable newNested)
public java.lang.String getNestedExceptionType()
public java.lang.String getMessage()
public java.lang.String getErrorKey()
public void printStackTrace()
public void printStackTrace(java.io.PrintStream p)
p - The PrintStream to write the exception messages intopublic void printStackTrace(java.io.PrintWriter p)
p - The PrintWriter to write the exception messages intopublic void addToStack(java.lang.String s)
s - The string to add: presumably the string representation of another stack tracepublic java.lang.String getStackTraceAsString()
private java.lang.String getStackTraceAsString(java.lang.Throwable t)
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||