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

## org.apache.commons.lang.exception
Class NestableError

    java.lang.Object
      |
      +--java.lang.Throwable
            |
            +--java.lang.Error
                  |
                  +--org.apache.commons.lang.exception.NestableError

All Implemented Interfaces:
  Nestable, Serializable

public class NestableError
extends Error
implements Nestable

The base class of all errors which can contain other exceptions.

Since:
  1.0
Version:
  $Id: NestableError.java 491650 2007-01-01 22:00:14Z ggregory $
Author:
  Daniel Rall
See Also:
  `NestableException`, Serialized Form

Field Summary
`protected NestableDelegate` | `delegate` The helper instance which contains much of the code which we delegate to.

Constructor Summary
`NestableError()` Constructs a new `NestableError` without specified detail message.
`NestableError(String msg)` Constructs a new `NestableError` with specified detail message.
`NestableError(String msg, Throwable cause)` Constructs a new `NestableError` with specified detail message and nested `Throwable`.
`NestableError(Throwable cause)` Constructs a new `NestableError` with specified nested `Throwable`.

Method Summary
`Throwable` | `getCause()` {@inheritDoc}
`String` | `getMessage()` Returns the detail message string of this throwable.
`String` | `getMessage(int index)` {@inheritDoc}
`String[]` | `getMessages()` {@inheritDoc}
`Throwable` | `getThrowable(int index)` {@inheritDoc}
`int` | `getThrowableCount()` {@inheritDoc}
`Throwable[]` | `getThrowables()` {@inheritDoc}
`int` | `indexOfThrowable(Class type)` {@inheritDoc}
`int` | `indexOfThrowable(Class type, int fromIndex)` {@inheritDoc}
`void` | `printPartialStackTrace(PrintWriter out)` {@inheritDoc}
`void` | `printStackTrace()` {@inheritDoc}
`void` | `printStackTrace(PrintStream out)` {@inheritDoc}
`void` | `printStackTrace(PrintWriter out)` {@inheritDoc}

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getLocalizedMessage, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### delegate

    protected NestableDelegate delegate

  The helper instance which contains much of the code which we delegate to.

Constructor Detail

### NestableError

    public NestableError()

  Constructs a new `NestableError` without specified detail message.

### NestableError

    public NestableError(String msg)

  Constructs a new `NestableError` with specified detail message.
  Parameters:
    `msg` - The error message.

### NestableError

    public NestableError(Throwable cause)

  Constructs a new `NestableError` with specified nested `Throwable`.
  Parameters:
    `cause` - the exception or error that caused this exception to be thrown

### NestableError

    public NestableError(String msg,
                         Throwable cause)

  Constructs a new `NestableError` with specified detail message and nested `Throwable`.
  Parameters:
    `msg` - the error message
    `cause` - the exception or error that caused this exception to be thrown

Method Detail

### getCause

    public Throwable getCause()

  {@inheritDoc}
  Specified by:
    `getCause` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Returns:
    throwable that caused the original exception

### getMessage

    public String getMessage()

  Returns the detail message string of this throwable. If it was created with a null message, returns the following: (cause==null ? null : cause.toString()).
  Specified by:
    `getMessage` in interface `Nestable`
  Overrides:
    `getMessage` in class `Throwable`
  Returns:
    String message string of the throwable

### getMessage

    public String getMessage(int index)

  {@inheritDoc}
  Specified by:
    `getMessage` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `index` - the index of the `Throwable` in the chain of `Throwable`s
  Returns:
    the error message, or null if the `Throwable` at the specified index in the chain does not contain a message
  Throws:
    `IndexOutOfBoundsException` - if the `index` argument is negative or not less than the count of `Throwable`s in the chain

### getMessages

    public String[] getMessages()

  {@inheritDoc}
  Specified by:
    `getMessages` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Returns:
    the error messages

### getThrowable

    public Throwable getThrowable(int index)

  {@inheritDoc}
  Specified by:
    `getThrowable` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `index` - the index, numbered from 0, of the `Throwable` in the chain of `Throwable`s
  Returns:
    the `Throwable`
  Throws:
    `IndexOutOfBoundsException` - if the `index` argument is negative or not less than the count of `Throwable`s in the chain

### getThrowableCount

    public int getThrowableCount()

  {@inheritDoc}
  Specified by:
    `getThrowableCount` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Returns:
    the throwable count

### getThrowables

    public Throwable[] getThrowables()

  {@inheritDoc}
  Specified by:
    `getThrowables` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Returns:
    the `Throwable`s

### indexOfThrowable

    public int indexOfThrowable(Class type)

  {@inheritDoc}
  Specified by:
    `indexOfThrowable` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `type` - the type to find, subclasses match, null returns -1
  Returns:
    index of the first occurrence of the type in the chain, or -1 if the type is not found

### indexOfThrowable

    public int indexOfThrowable(Class type,
                                int fromIndex)

  {@inheritDoc}
  Specified by:
    `indexOfThrowable` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `type` - the type to find, subclasses match, null returns -1
    `fromIndex` - the index, numbered from 0, of the starting position in the chain to be searched
  Returns:
    index of the first occurrence of the type in the chain, or -1 if the type is not found
  Throws:
    `IndexOutOfBoundsException` - if the `fromIndex` argument is negative or not less than the count of `Throwable`s in the chain

### printStackTrace

    public void printStackTrace()

  {@inheritDoc}
  Overrides:
    `printStackTrace` in class `Throwable`

### printStackTrace

    public void printStackTrace(PrintStream out)

  {@inheritDoc}
  Specified by:
    `printStackTrace` in interface `Nestable`
  Overrides:
    `printStackTrace` in class `Throwable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `out` - `PrintStream` to use for output.

### printStackTrace

    public void printStackTrace(PrintWriter out)

  {@inheritDoc}
  Specified by:
    `printStackTrace` in interface `Nestable`
  Overrides:
    `printStackTrace` in class `Throwable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `out` - `PrintWriter` to use for output.

### printPartialStackTrace

    public final void printPartialStackTrace(PrintWriter out)

  {@inheritDoc}
  Specified by:
    `printPartialStackTrace` in interface `Nestable`
  Following copied from interface: `org.apache.commons.lang.exception.Nestable`
  Parameters:
    `out` - The writer to use.

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

Copyright © 2001-2005 - Apache Software Foundation