org.pf.util
Class WrappingRuntimeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.pf.util.WrappingRuntimeException
All Implemented Interfaces:
java.io.Serializable

public class WrappingRuntimeException
extends java.lang.RuntimeException

This runtime exception can be used to wrap a "normal" exception. This allows to catch a "normal" exception, but it into a WrappingRuntimeException and throw the WrappingRuntimeException instead. The benefit is to avoid the annoying an quite often useless throws clauses in the method signature. As consequnce no try/catch blocks must be put around the callers of such a method. FIGHT CODE POLLUTION!

Version:
1.0
Author:
Manfred Duchrow
See Also:
Serialized Form

Constructor Summary
WrappingRuntimeException(java.lang.Exception ex)
          Initialize the new instance with default values.
 
Method Summary
 void printStackTrace()
          Print the stack trace of the wrapped exception to stdout
 void printStackTrace(java.io.PrintStream stream)
          Print the stack trace of the wrapped exception to the given stream
 void printStackTrace(java.io.PrintWriter writer)
          Print the stack trace of the wrapped exception to the given writer
 java.lang.String toString()
          Returns the string representation of the wrapped exception
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappingRuntimeException

public WrappingRuntimeException(java.lang.Exception ex)
Initialize the new instance with default values.

Method Detail

toString

public java.lang.String toString()
Returns the string representation of the wrapped exception

Overrides:
toString in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Print the stack trace of the wrapped exception to stdout

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream stream)
Print the stack trace of the wrapped exception to the given stream

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter writer)
Print the stack trace of the wrapped exception to the given writer

Overrides:
printStackTrace in class java.lang.Throwable