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. |
ex
public final Exception ex
- The exception this object wraps around.
WrappedRuntimeException
public WrappedRuntimeException(Exception ex)
- Creates a new WrappedRuntimeException.
- Parameters:
ex
- The exception to wrap around.- Throws:
NullPointerException
- If ex
is null
.
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