to.etc.util
Class WrappedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by to.etc.util.WrappedException
All Implemented Interfaces:
java.io.Serializable

public class WrappedException
extends java.lang.RuntimeException

Helper class for managing the checked exception idiocy rampant in Java code. It wraps checked exceptions in unchecked ones, and has a method to unwrap them again at a higher level.

Author:
Frits Jalvingh Created on Nov 25, 2010
See Also:
Serialized Form

Constructor Summary
WrappedException(java.lang.String message, java.lang.Throwable cause)
           
WrappedException(java.lang.Throwable cause)
           
 
Method Summary
static java.lang.Exception unwrap(java.lang.Exception x)
           
static java.lang.RuntimeException wrap(java.lang.Exception x)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedException

public WrappedException(java.lang.String message,
                        java.lang.Throwable cause)

WrappedException

public WrappedException(java.lang.Throwable cause)
Method Detail

wrap

public static java.lang.RuntimeException wrap(java.lang.Exception x)

unwrap

public static java.lang.Exception unwrap(java.lang.Exception x)