org.apache.commons.lang.exception

Class NestableRuntimeException

Implemented Interfaces:
Nestable
Known Direct Subclasses:
SerializationException, UnhandledException

public class NestableRuntimeException
extends RuntimeException
implements Nestable

The base class of all runtime exceptions 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

NestableRuntimeException()
Constructs a new NestableRuntimeException without specified detail message.
NestableRuntimeException(String msg)
Constructs a new NestableRuntimeException with specified detail message.
NestableRuntimeException(String msg, Throwable cause)
Constructs a new NestableRuntimeException with specified detail message and nested Throwable.
NestableRuntimeException(Throwable cause)
Constructs a new NestableRuntimeException 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

NestableRuntimeException

public NestableRuntimeException()
Constructs a new NestableRuntimeException without specified detail message.

NestableRuntimeException

public NestableRuntimeException(String msg)
Constructs a new NestableRuntimeException with specified detail message.
Parameters:
msg - the error message

NestableRuntimeException

public NestableRuntimeException(String msg,
                                Throwable cause)
Constructs a new NestableRuntimeException with specified detail message and nested Throwable.
Parameters:
msg - the error message
cause - the exception or error that caused this exception to be thrown

NestableRuntimeException

public NestableRuntimeException(Throwable cause)
Constructs a new NestableRuntimeException 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