com.generationjava.lang
Class CascadedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.generationjava.lang.CascadedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WritingException

public class CascadedException
extends java.lang.Exception

An Exception which is being thrown on top of another Throwable. That is, some code has caught an Exception and wishes to throw a different Exception upwards as a result. This class allows the original Exception to still be accessible.

See Also:
Serialized Form

Constructor Summary
CascadedException()
           
CascadedException(java.lang.String s)
           
CascadedException(java.lang.String s, java.lang.Throwable t)
           
CascadedException(java.lang.Throwable t)
           
 
Method Summary
 java.lang.Throwable getWrappedThrowable()
          Access the original exception.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream ps)
           
 void printStackTrace(java.io.PrintWriter pw)
           
 void setWrappedThrowable(java.lang.Throwable t)
          Reset the original exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CascadedException

public CascadedException(java.lang.String s)

CascadedException

public CascadedException()

CascadedException

public CascadedException(java.lang.String s,
                         java.lang.Throwable t)

CascadedException

public CascadedException(java.lang.Throwable t)
Method Detail

getWrappedThrowable

public java.lang.Throwable getWrappedThrowable()
Access the original exception.

Returns:
Throwable that was initially throw

setWrappedThrowable

public void setWrappedThrowable(java.lang.Throwable t)
Reset the original exception.

Parameters:
t - Throwable to be wrapped

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Overrides:
printStackTrace in class java.lang.Throwable