public interface ThrowableList
This interface should be implemented by classes derived from Throwable
that may contain a stacked, additional or wrapped throwable.
Such cases are common when
We provide the expected code in block comments starting with -->, terminated
by -->. Note that the provided code also includes a new implementation of
the base class method Throwable.getMessage()
using the text
formatting capabilities of MessageFormat
.
ExceptionList
interface.
Note: With JDK 1.4, the chained exception facility
is available, that implements a Throwable stack (or list of causes) already
in Throwable
. Still, the notion of a wrapped exception and
the delayed formatting is a reason for this interface.
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
getArguments()
Retrieving the arguments for message formats.
|
java.lang.Throwable |
getCause()
Retrieving the cause of a
Throwable . |
java.lang.String |
getFormat()
Getting the format string of a throwable message.
|
boolean |
isWrapper()
Check if
this is only a throwable that wraps the real one. |
java.lang.Throwable |
nextThrowable()
Deprecated.
use the JDK 1.4 call
getCause() instead |
java.lang.Throwable getCause()
Throwable
. This is the method introduced
with JDK 1.4. It replaces the older nextThrowable()
.Throwable
Throwable.getCause()
java.lang.Throwable nextThrowable()
getCause()
insteadnextThrowable
>
returns the "earlier" throwable. By walking down the throwable list one gets the
the following meaning:
IOException
, but actually has to pass on a
SQLException
. That could be done by wrapping the SQLException
into the IOException
.
boolean isWrapper()
this
is only a throwable that wraps the real one. This
might be nessecary to pass an throwable incompatible to a method declaration.true
if this is a wrapper throwable,
false
otherwisejava.lang.String getFormat()
MessageFormat
getArguments()
java.lang.Object[] getArguments()
MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
call.getFormat()