| de.susebox.java.lang.ThrowableList
All known Subclasses: de.susebox.java.lang.ExtIndexOutOfBoundsException, de.susebox.jtopas.TokenizerException, de.susebox.java.lang.ExtRuntimeException, de.susebox.java.lang.ExtUnsupportedOperationException, de.susebox.java.lang.ExtNullPointerException, de.susebox.java.io.ExtIOException, de.susebox.java.lang.ExtNoSuchMethodException, de.susebox.java.util.ExtNoSuchElementException, de.susebox.java.lang.ExtIllegalArgumentException,
ThrowableList | public interface ThrowableList (Code) | |
This interface should be implemented by classes derived from
java.lang.Throwable that may contain a stacked, additional or wrapped throwable.
Such cases are common when
-
a method implements a certain interface method that allows for a specific
throwable like IOException, but the method itself may encounter a different
throwable type like SQLException (wrapped throwable)
-
one application layer catches an throwable only to add its specific
information in form of another throwable (throwable stack, nested throwable
like in SQLException or MessagingException).
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
java.lang.Throwable.getMessage using the text
formatting capabilities of
java.text.MessageFormat .
Note: This interface replaces the formerly used ExceptionList
interface.
Note: With JDK 1.4, the chained exception facility
is available, that implements a Throwable stack (or list of causes) already
in
java.lang.Throwable . Still, the notion of a wrapped exception and
the delayed formatting is a reason for this interface.
version: 1.00, 2001/06/26 author: Heiko Blau |
isWrapper | public boolean isWrapper()(Code) | | Check if 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 otherwise |
nextThrowable | public Throwable nextThrowable()(Code) | | Method to traverse the throwable list. By convention, nextThrowable >
returns the "earlier" throwable. By walking down the throwable list one gets the
the following meaning:
this happened because nextThrowable happened because nextThrowable happened...
The next throwable has usually one of the following meaning:
-
It is the "real" throwable. An interface implementation might be allowed to
throw only
IOException , but actually has to pass on a
SQLException . That could be done by wrapping the SQLException
into the IOException .
-
The next throwable is "deeper" cause of this one (often called a nested
throwable). A file couldn't be read in the first place and therefore not be
attached to a mail. Both this throwable and the one nested inside have their
own message.
There are more than one basic throwable to be propagated. A simple parser
might return all syntax errors in one throwable list.
the "earlier" throwableThrowableList.getCause |
|
|