gausssoft.lang
Class WrappedRuntimeException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--gausssoft.lang.WrappedRuntimeException
All Implemented Interfaces:
Serializable

public class WrappedRuntimeException
extends RuntimeException

This class wraps around an Exception, and allows it to be thrown at any point in any method.

RuntimeException and any of it's subclasses may be thrown without the surrounding method declaring in it's throws clause. Normal exceptions can only be thrown if the surrounding method declares it explicitly.

So this class allows an exception to be indirectly thrown in a method which doesn't permit it to be thrown in normal conditions. All methods invoked on this object will call the method of of the internal exception.

Author:
Allan Crooks
See Also:
RuntimeException, Exception, Serialized Form

Field Summary
 Exception ex
          The exception this object wraps around.
 
Constructor Summary
WrappedRuntimeException(Exception ex)
          Creates a new WrappedRuntimeException.
 
Method Summary
 Throwable fillInStackTrace()
           
 String getLocalizedMessage()
           
 String getMessage()
           
 void printStackTrace()
           
 void printStackTrace(PrintStream ps)
           
 void printStackTrace(PrintWriter pw)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ex

public final Exception ex
The exception this object wraps around.
Constructor Detail

WrappedRuntimeException

public WrappedRuntimeException(Exception ex)
Creates a new WrappedRuntimeException.
Parameters:
ex - The exception to wrap around.
Throws:
NullPointerException - If ex is null.
Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

getLocalizedMessage

public String getLocalizedMessage()
Overrides:
getLocalizedMessage in class Throwable

toString

public String toString()
Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream ps)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter pw)
Overrides:
printStackTrace in class Throwable

fillInStackTrace

public Throwable fillInStackTrace()
Overrides:
fillInStackTrace in class Throwable