|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
An interface to be implemented by Throwable
extensions which would like to be able to nest root exceptions
inside themselves.
| Method Summary | |
java.lang.Throwable |
getCause()
Returns the reference to the exception or error that caused the exception implementing the Nestable to be thrown. |
int |
getLength()
Returns the number of nested Throwables represented by
this Nestable, including this Nestable. |
java.lang.String |
getMessage()
Returns the error message of this and any nested Throwable. |
java.lang.String |
getMessage(int index)
Returns the error message of the Throwable in the chain
of Throwables at the specified index, numbererd from 0. |
java.lang.String[] |
getMessages()
Returns the error message of this and any nested Throwables
in an array of Strings, one element for each message. |
java.lang.Throwable |
getThrowable(int index)
Returns the Throwable in the chain of
Throwables at the specified index, numbererd from 0. |
java.lang.Throwable[] |
getThrowables()
Returns the error message of this and any nested Throwables
in an array of Strings, one element for each message. |
int |
indexOfThrowable(java.lang.Class type)
Returns the index, numbered from 0, of the first occurrence of the specified type in the chain of Throwables, or -1 if the
specified type is not found in the chain. |
int |
indexOfThrowable(int pos,
java.lang.Class type)
Returns the index, numbered from 0, of the first Throwable
that matches the specified type in the chain of Throwables
with an index greater than or equal to the specified position, or -1 if
the type is not found. |
void |
printPartialStackTrace(java.io.PrintWriter out)
Prints the stack trace for this exception only--root cause not included--using the provided writer. |
void |
printStackTrace(java.io.PrintWriter out)
Prints the stack trace of this exception to the specified print writer. |
| Method Detail |
public java.lang.Throwable getCause()
Nestable to be thrown.public int getLength()
Throwables represented by
this Nestable, including this Nestable.public java.lang.String getMessage()
Throwable.public java.lang.String getMessage(int index)
Throwable in the chain
of Throwables at the specified index, numbererd from 0.
If index is negative, the effect is the same as if it
were 0. If index is greater than or equal to the length
of the chain, the message of the last Throwable in the
chain is returned.index - the index of the Throwable in the chain of
Throwablespublic java.lang.String[] getMessages()
Throwables
in an array of Strings, one element for each message. Any
Throwable specified without a message is represented in
the array by a null.public java.lang.Throwable getThrowable(int index)
Throwable in the chain of
Throwables at the specified index, numbererd from 0. If
index is negative, the effect is the same as if it
were 0. If index is greater than or equal to the length
of the chain, the last Throwable in the chain is returned.index - the index of the Throwable in the chain of
ThrowablesThrowablepublic java.lang.Throwable[] getThrowables()
Throwables
in an array of Strings, one element for each message. Any
Throwable specified without a message is represented in
the array by a null.Throwablespublic int indexOfThrowable(java.lang.Class type)
Throwables, or -1 if the
specified type is not found in the chain. If pos is
negative, the effect is the same as if it were 0. If pos
is greater than or equal to the length of the chain, the effect is the
same as if it were the index of the last element in the chain.type - Class to be found
public int indexOfThrowable(int pos,
java.lang.Class type)
Throwable
that matches the specified type in the chain of Throwables
with an index greater than or equal to the specified position, or -1 if
the type is not found. If pos is negative, the effect is the
same as if it were 0. If pos is greater than or equal to the
length of the chain, the effect is the same as if it were the index of
the last element in the chain.type - Class to be foundpos - index, numbered from 0, of the starting position in the chain
to be searchedpublic void printStackTrace(java.io.PrintWriter out)
out - PrintWriter to use for output.public void printPartialStackTrace(java.io.PrintWriter out)
NestableDelegate to write
individual stack traces to a buffer. The implementation of
this method should call
super.printStackTrace(out); in most cases.out - The writer to use.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||