tyrex.util

Class NestedException

public abstract class NestedException extends Exception

Base type for all Type exceptions.

This exception can optionally wrap another exception. The printed stack trace will be that of the wrapped exception, if one is provided in the constructor. The underlying exception can be obtained from getException.

Several exceptions support wrapping of an underlying exception by extending from this class. When another nested exception is provided in the constructor, the underlying exception will be used, so it's safe to construct a nested exception from another nested exception.

Support for unwrapping the underlying exceptions include NestedException, org.xml.sax.SAXException.

Version: $Revision: 1.2 $

Author: Assaf Arkin

Constructor Summary
NestedException(String message, Exception except)
Construct a new nested exception wrapping an underlying exception and providing a message.
NestedException(String message)
Construct a new nested with a message.
NestedException(Exception except)
Construct a new nested exception wrapping an underlying exception.
Method Summary
ExceptiongetException()
Returns the underlying exception, if this exception wraps another exception.
voidprintStackTrace()
voidprintStackTrace(PrintStream stream)
voidprintStackTrace(PrintWriter writer)

Constructor Detail

NestedException

public NestedException(String message, Exception except)
Construct a new nested exception wrapping an underlying exception and providing a message.

Parameters: message The exception message except The underlying exception

NestedException

public NestedException(String message)
Construct a new nested with a message.

Parameters: message The exception message

NestedException

public NestedException(Exception except)
Construct a new nested exception wrapping an underlying exception.

Parameters: except The underlying exception

Method Detail

getException

public Exception getException()
Returns the underlying exception, if this exception wraps another exception.

Returns: The underlying exception, or null

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(PrintStream stream)

printStackTrace

public void printStackTrace(PrintWriter writer)
Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.