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 | CompositeException.ExceptionOverview
Contains a formatted message with a simplified representation of the exception graph contained within the CompositeException. |
| 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 | CompositeException.WrappedPrintWriter
Same abstraction and implementation as in JDK to allow PrintStream and PrintWriter to share implementation. |
| Modifier and Type | Field and Description |
|---|---|
| private Throwable | |
| private final List | |
| private final String | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | CompositeException(@NonNull 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(@NonNull 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 @NonNull Throwable | getCause()
Overrides java. null if the
cause is nonexistent or unknown.
|
| public @NonNull List | |
| public @NonNull String | getMessage()
Overrides java. |
| 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 outputSpecial 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(@NonNull Throwable... exceptions) Constructs a CompositeException with the given array of Throwables as the list of suppressed exceptions.
| |
| CompositeException | back to summary |
|---|---|
| public CompositeException(@NonNull 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(CompositeException. | |
| getCause | back to summary |
|---|---|
| public synchronized @NonNull 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 @NonNull List Retrieves the list of exceptions that make up the | |
| getMessage | back to summary |
|---|---|
| public @NonNull String getMessage() Overrides java. Doc from java. Returns the detail message string of this throwable. | |
| 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 |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Throwable | fillInStackTrace()
Overrides java. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ExceptionOverview | back to summary |
|---|---|
| pack-priv ExceptionOverview(String message) | |
| fillInStackTrace | back to summary |
|---|---|
| public synchronized Throwable fillInStackTrace() Overrides java. Doc from java. Fills in the execution stack trace. This method records within this
If the stack trace of this | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract CompositeException. |
| PrintStreamOrWriter | back to summary |
|---|---|
| pack-priv PrintStreamOrWriter() | |
| append | back to summary |
|---|---|
| pack-priv abstract CompositeException. Prints the object's string representation via the underlying PrintStream or PrintWriter.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final PrintStream |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv CompositeException. | append(Object
the object to print o)Implements abstract io. |
| printStream | back to summary |
|---|---|
| private final PrintStream printStream | |
| WrappedPrintStream | back to summary |
|---|---|
| pack-priv WrappedPrintStream(PrintStream printStream) | |
| append | back to summary |
|---|---|
| pack-priv CompositeException. Implements abstract io. Doc from io. Prints the object's string representation via the underlying PrintStream or PrintWriter.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final PrintWriter |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv CompositeException. | append(Object
the object to print o)Implements abstract io. |
| printWriter | back to summary |
|---|---|
| private final PrintWriter printWriter | |
| WrappedPrintWriter | back to summary |
|---|---|
| pack-priv WrappedPrintWriter(PrintWriter printWriter) | |
| append | back to summary |
|---|---|
| pack-priv CompositeException. Implements abstract io. Doc from io. Prints the object's string representation via the underlying PrintStream or PrintWriter.
| |