Class MultiException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.directory.api.util.exception.MultiException
-
- All Implemented Interfaces:
Serializable
public class MultiException extends Exception
This exception is thrown when Base class for nested exceptions.- Author:
- Apache Directory Project
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static longserialVersionUIDThe serialVersionUID.
-
Constructor Summary
Constructors Constructor Description MultiException()Constructs an Exception without a message.MultiException(String message)Constructs an Exception with a detailed message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddThrowable(Throwable nested)Add an exception to this multiexception.booleanisEmpty()Tests to see if there are any nested exceptions within this MultiException.Iterator<Throwable>listNestedExceptions()Lists the nested exceptions that this Exception encapsulates.voidprintStackTrace()Beside printing out the standard stack trace this method prints out the stack traces of all the nested exceptions using standard error.voidprintStackTrace(PrintStream out)Beside printing out the standard stack trace this method prints out the stack traces of all the nested exceptions.voidprintStackTrace(PrintWriter out)Beside printing out the standard stack trace this method prints out the stack traces of all the nested exceptions.intsize()Gets the size of this nested exception which equals the number of exception nested within.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
The serialVersionUID.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultiException
public MultiException()
Constructs an Exception without a message.
-
MultiException
public MultiException(String message)
Constructs an Exception with a detailed message.- Parameters:
message- The message associated with the exception.
-
-
Method Detail
-
listNestedExceptions
public Iterator<Throwable> listNestedExceptions()
Lists the nested exceptions that this Exception encapsulates.- Returns:
- an Iterator over the nested exceptions.
-
size
public int size()
Gets the size of this nested exception which equals the number of exception nested within.- Returns:
- the size of this nested exception.
-
isEmpty
public boolean isEmpty()
Tests to see if there are any nested exceptions within this MultiException.- Returns:
- true if no exceptions are nested, false otherwise.
-
addThrowable
public void addThrowable(Throwable nested)
Add an exception to this multiexception.- Parameters:
nested- exception to add to this MultiException.
-
printStackTrace
public void printStackTrace(PrintWriter out)
Beside printing out the standard stack trace this method prints out the stack traces of all the nested exceptions.- Overrides:
printStackTracein classThrowable- Parameters:
out- PrintWriter to write the nested stack trace to.
-
printStackTrace
public void printStackTrace(PrintStream out)
Beside printing out the standard stack trace this method prints out the stack traces of all the nested exceptions.- Overrides:
printStackTracein classThrowable- Parameters:
out- PrintStream to write the nested stack trace to.
-
printStackTrace
public void printStackTrace()
Beside printing out the standard stack trace this method prints out the stack traces of all the nested exceptions using standard error.- Overrides:
printStackTracein classThrowable
-
-