CompositeException
does not modify the structure of any exception it wraps, but at print-time it iterates through the list of
Throwables contained in the composite in order to print them all.
Its invariant is to contain an immutable, ordered (by insertion order), unique list of non-composite
exceptions. You can retrieve individual exceptions in this list with getExceptions().
The printStackTrace() implementation handles the StackTrace in a customized way instead of using
getCause() so that it can avoid circular references.
If you invoke getCause(), it will lazily create the causal chain but will stop if it finds any
Throwable in the chain that it has already seen.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv abstract static class | |
| pack-priv static class | CompositeException.WrappedPrintStream
Same abstraction and implementation as in JDK to allow PrintStream and PrintWriter to share implementation. |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private Throwable | |
| private final List | |
| private final String | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | CompositeException(Throwable...
the Throwables to have as initially suppressed exceptions exceptions)Constructs a CompositeException with the given array of Throwables as the list of suppressed exceptions. |
| public | CompositeException(Iterable<? extends Throwable>
the Throwables to have as initially suppressed exceptions errors)Constructs a CompositeException with the given array of Throwables as the list of suppressed exceptions. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public synchronized Throwable | getCause()
Overrides java. null if the
cause is nonexistent or unknown.
|
| public List | |
| private List | |
| public String | getMessage()
Overrides java. |
| pack-priv Throwable | Returns: The root cause ofe. If e.getCause() returns null or e, just return e itself.the e)Throwable e.Returns the root cause of |
| public void | printStackTrace()
Overrides java. printStackTrace functionality is derived from JDK Throwable
printStackTrace.
|
| public void | printStackTrace(PrintStream
PrintStream to use for outputOverrides java. |
| public void | printStackTrace(PrintWriter
PrintWriter to use for outputOverrides java. |
| private void | printStackTrace(CompositeException.
stream to print to sSpecial handling for printing out a |
| public int |
| cause | back to summary |
|---|---|
| private Throwable cause Hides java. | |
| exceptions | back to summary |
|---|---|
| private final List<Throwable> exceptions | |
| message | back to summary |
|---|---|
| private final String message | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| CompositeException | back to summary |
|---|---|
| public CompositeException(Throwable... exceptions) Constructs a CompositeException with the given array of Throwables as the list of suppressed exceptions.
| |
| CompositeException | back to summary |
|---|---|
| public CompositeException(Iterable<? extends Throwable> errors) Constructs a CompositeException with the given array of Throwables as the list of suppressed exceptions.
| |
| appendStackTrace | back to summary |
|---|---|
| private void appendStackTrace(StringBuilder b, Throwable ex, String prefix) | |
| getCause | back to summary |
|---|---|
| public synchronized Throwable getCause() Overrides java. Doc from java. Returns the cause of this throwable or This implementation returns the cause that was supplied via one of
the constructors requiring a | |
| getExceptions | back to summary |
|---|---|
| public List Retrieves the list of exceptions that make up the | |
| getListOfCauses | back to summary |
|---|---|
| private List | |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides java. Doc from java. Returns the detail message string of this throwable. | |
| getRootCause | back to summary |
|---|---|
| pack-priv Throwable getRootCause(Throwable e) Returns the root cause of | |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace() Overrides java. All of the following
| |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace(PrintStream s) Overrides java. Doc from java. Prints this throwable and its backtrace to the specified print stream.
| |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace(PrintWriter s) Overrides java. Doc from java. Prints this throwable and its backtrace to the specified print writer.
| |
| printStackTrace | back to summary |
|---|---|
| private void printStackTrace(CompositeException. Special handling for printing out a
| |
| size | back to summary |
|---|---|
| public int size() Returns the number of suppressed exceptions.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String | getMessage()
Overrides java. |
| MESSAGE | back to summary |
|---|---|
| pack-priv static final String MESSAGE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| CompositeExceptionCausalChain | back to summary |
|---|---|
| pack-priv CompositeExceptionCausalChain() | |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides java. Doc from java. Returns the detail message string of this throwable. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract void |
| PrintStreamOrWriter | back to summary |
|---|---|
| pack-priv PrintStreamOrWriter() | |
| println | back to summary |
|---|---|
| pack-priv abstract void println(Object o) Prints the specified string as a line on this StreamOrWriter. | |
| Modifier and Type | Field and Description |
|---|---|
| private final PrintStream |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | println(Object o)
Implements abstract io. |
| printStream | back to summary |
|---|---|
| private final PrintStream printStream | |
| WrappedPrintStream | back to summary |
|---|---|
| pack-priv WrappedPrintStream(PrintStream printStream) | |
| println | back to summary |
|---|---|
| pack-priv void println(Object o) Implements abstract io. Doc from io. Prints the specified string as a line on this StreamOrWriter.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final PrintWriter |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | println(Object o)
Implements abstract io. |
| printWriter | back to summary |
|---|---|
| private final PrintWriter printWriter | |
| WrappedPrintWriter | back to summary |
|---|---|
| pack-priv WrappedPrintWriter(PrintWriter printWriter) | |
| println | back to summary |
|---|---|
| pack-priv void println(Object o) Implements abstract io. Doc from io. Prints the specified string as a line on this StreamOrWriter.
| |