Oracle

com.compoze.util
Class NestedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.compoze.util.NestedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DominoException

public abstract class NestedException
extends java.lang.Exception
implements java.io.Serializable

This class is an exception that wraps another exception. Any nested exception traces are included when the stack trace is printed. Contrast this with NestedRuntimeException, which is a similar but unchecked exception.

See Also:
NestedRuntimeException, Serialized Form

Constructor Summary
NestedException()
          Constructor.
NestedException(java.lang.Exception e)
          Constructor.
NestedException(java.lang.Exception e, java.lang.String sMessage)
          Constructor.
NestedException(java.lang.String sMessage)
          Constructor.
NestedException(java.lang.Throwable t)
          Constructor.
NestedException(java.lang.Throwable t, java.lang.String sMessage)
          Constructor.
 
Method Summary
 java.lang.Throwable getNestedException()
          Get the nested exception.
 void printStackTrace()
          Print stack trace of this exception and the underlying exception if available.
 void printStackTrace(java.io.PrintStream printStream)
          Print stack trace of this exception and the underlying exception if available.
 void printStackTrace(java.io.PrintWriter writer)
          Print stack trace of this exception and the underlying exception if available.
 java.lang.String toString()
          Create a string representation of the exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NestedException

public NestedException()
Constructor.


NestedException

public NestedException(java.lang.String sMessage)
Constructor.

Parameters:
sMessage - a detail message for the exception

NestedException

public NestedException(java.lang.Exception e)
Constructor.

Parameters:
e - the underlying exception

NestedException

public NestedException(java.lang.Exception e,
                       java.lang.String sMessage)
Constructor.

Parameters:
e - the underlying exception
sMessage - a detail message for the exception

NestedException

public NestedException(java.lang.Throwable t)
Constructor.

Parameters:
t - the underlying throwable

NestedException

public NestedException(java.lang.Throwable t,
                       java.lang.String sMessage)
Constructor.

Parameters:
t - the underlying throwable
sMessage - a detail message for the exception
Method Detail

getNestedException

public java.lang.Throwable getNestedException()
Get the nested exception.

Returns:
the nested exception, or null if there isn't one

printStackTrace

public void printStackTrace()
Print stack trace of this exception and the underlying exception if available.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter writer)
Print stack trace of this exception and the underlying exception if available.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
writer - the writer to print to

printStackTrace

public void printStackTrace(java.io.PrintStream printStream)
Print stack trace of this exception and the underlying exception if available.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
printStream - the print stream to print to

toString

public java.lang.String toString()
Create a string representation of the exception.

Overrides:
toString in class java.lang.Throwable

Oracle

Copyright ©1999-2008 Oracle All rights reserved.