org.mortbay.util
Class MultiException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.mortbay.util.MultiException
All Implemented Interfaces:
Serializable

public class MultiException
extends Exception

Wraps multiple exceptions. Allows multiple exceptions to be thrown as a single exception.

Author:
Greg Wilkins (gregw)
See Also:
Serialized Form

Field Summary
private  Object nested
           
 
Constructor Summary
MultiException()
           
 
Method Summary
 void add(Throwable e)
           
 Throwable getThrowable(int i)
           
 List getThrowables()
           
 void ifExceptionThrow()
          Throw a multiexception.
 void ifExceptionThrowMulti()
          Throw a multiexception.
 void printStackTrace()
           
 void printStackTrace(PrintStream out)
           
 void printStackTrace(PrintWriter out)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nested

private Object nested
Constructor Detail

MultiException

public MultiException()
Method Detail

add

public void add(Throwable e)

size

public int size()

getThrowables

public List getThrowables()

getThrowable

public Throwable getThrowable(int i)

ifExceptionThrow

public void ifExceptionThrow()
                      throws Exception
Throw a multiexception. If this multi exception is empty then no action is taken. If it contains a single exception that is thrown, otherwise the this multi exception is thrown.

Throws:
Exception

ifExceptionThrowMulti

public void ifExceptionThrowMulti()
                           throws MultiException
Throw a multiexception. If this multi exception is empty then no action is taken. If it contains a any exceptions then this multi exception is thrown.

Throws:
MultiException

toString

public String toString()
Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream out)
Overrides:
printStackTrace in class Throwable
See Also:
Throwable.printStackTrace(java.io.PrintStream)

printStackTrace

public void printStackTrace(PrintWriter out)
Overrides:
printStackTrace in class Throwable
See Also:
Throwable.printStackTrace(java.io.PrintWriter)