Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.util
Class MultiException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.mortbay.util.MultiException

All Implemented Interfaces:
  java.io.Serializable

    public class MultiException

extends java.lang.Exception

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

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

Constructor Summary
`MultiException()`

Method Summary
`void` | `add(java.lang.Throwable e)`
`java.lang.Throwable` | `getThrowable(int i)`
`java.util.List` | `getThrowables()`
`void` | `ifExceptionThrow()` Throw a multiexception.
`void` | `ifExceptionThrowMulti()` Throw a multiexception.
`void` | `ifExceptionThrowRuntime()` Throw a Runtime exception.
`void` | `printStackTrace()`
`void` | `printStackTrace(java.io.PrintStream out)`
`void` | `printStackTrace(java.io.PrintWriter out)`
`int` | `size()`
`java.lang.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`

Constructor Detail

### MultiException

    public MultiException()

Method Detail

### add

    public void add(java.lang.Throwable e)

### size

    public int size()

### getThrowables

    public java.util.List getThrowables()

### getThrowable

    public java.lang.Throwable getThrowable(int i)

### ifExceptionThrow

    public void ifExceptionThrow()
                          throws java.lang.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:
    `java.lang.Exception`

### ifExceptionThrowRuntime

    public void ifExceptionThrowRuntime()
                                 throws java.lang.Error

  Throw a Runtime exception. If this multi exception is empty then no action is taken. If it contains a single error or runtime exception that is thrown, otherwise the this multi exception is thrown, wrapped in a runtime exception.

  Throws:
    `java.lang.Error` - If this exception contains exactly 1 `Error`
    `java.lang.RuntimeException` - If this exception contains 1 `Throwable` but it is not an error, or it contains more than 1 `Throwable` of any type.

### 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 java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace()

  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace(java.io.PrintStream out)

  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  See Also:
    `Throwable.printStackTrace(java.io.PrintStream)`

### printStackTrace

    public void printStackTrace(java.io.PrintWriter out)

  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  See Also:
    `Throwable.printStackTrace(java.io.PrintWriter)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.