org.apache.commons.lang.exception

Class NestableError

Implemented Interfaces:
Nestable

public class NestableError
extends Error
implements Nestable

The base class of all errors which can contain other exceptions.
Since:
1.0
See Also:
NestableException

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()
String
getMessage()
Returns the detail message string of this throwable.
String
getMessage(int index)
String[]
getMessages()
Throwable
getThrowable(int index)
int
getThrowableCount()
Throwable[]
getThrowables()
int
indexOfThrowable(Class type)
int
indexOfThrowable(Class type, int fromIndex)
void
printPartialStackTrace(PrintWriter out)
void
printStackTrace()
void
printStackTrace(PrintStream out)
void
printStackTrace(PrintWriter out)

Field Details

delegate

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

Constructor Details

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(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

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

Method Details

getCause

public Throwable getCause()
Specified by:
getCause in interface Nestable

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
Returns:
String message string of the throwable

getMessage

public String getMessage(int index)
Specified by:
getMessage in interface Nestable

getMessages

public String[] getMessages()
Specified by:
getMessages in interface Nestable

getThrowable

public Throwable getThrowable(int index)
Specified by:
getThrowable in interface Nestable

getThrowableCount

public int getThrowableCount()
Specified by:
getThrowableCount in interface Nestable

getThrowables

public Throwable[] getThrowables()
Specified by:
getThrowables in interface Nestable

indexOfThrowable

public int indexOfThrowable(Class type)
Specified by:
indexOfThrowable in interface Nestable

indexOfThrowable

public int indexOfThrowable(Class type,
                            int fromIndex)
Specified by:
indexOfThrowable in interface Nestable

printPartialStackTrace

public final void printPartialStackTrace(PrintWriter out)
Specified by:
printPartialStackTrace in interface Nestable

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(PrintStream out)
Specified by:
printStackTrace in interface Nestable

printStackTrace

public void printStackTrace(PrintWriter out)
Specified by:
printStackTrace in interface Nestable