org.jfree.util

Class StackableRuntimeException

public class StackableRuntimeException extends RuntimeException

A baseclass for RuntimeExceptions, which could have parent exceptions. These parent exceptions are raised in a subclass and are now wrapped into a subclass of this Exception.

The parents are printed when this exception is printed. This class exists mainly for debugging reasons, as with them it is easier to detect the root cause of an error.

Author: Thomas Morgner

Constructor Summary
StackableRuntimeException()
Creates a StackableRuntimeException with no message and no parent.
StackableRuntimeException(String message, Exception ex)
Creates an exception.
StackableRuntimeException(String message)
Creates an exception.
Method Summary
ExceptiongetParent()
Returns the parent exception (possibly null).
voidprintStackTrace(PrintStream stream)
Prints the stack trace to the specified stream.
voidprintStackTrace(PrintWriter writer)
Prints the stack trace to the specified writer.

Constructor Detail

StackableRuntimeException

public StackableRuntimeException()
Creates a StackableRuntimeException with no message and no parent.

StackableRuntimeException

public StackableRuntimeException(String message, Exception ex)
Creates an exception.

Parameters: message the exception message. ex the parent exception.

StackableRuntimeException

public StackableRuntimeException(String message)
Creates an exception.

Parameters: message the exception message.

Method Detail

getParent

public Exception getParent()
Returns the parent exception (possibly null).

Returns: the parent exception.

printStackTrace

public void printStackTrace(PrintStream stream)
Prints the stack trace to the specified stream.

Parameters: stream the output stream.

printStackTrace

public void printStackTrace(PrintWriter writer)
Prints the stack trace to the specified writer.

Parameters: writer the writer.