info.magnolia.cms.util
Class ExceptionUtil

java.lang.Object
  extended by info.magnolia.cms.util.ExceptionUtil

public class ExceptionUtil
extends java.lang.Object

Util to handle exceptions.

Version:
$Revision: $ ($Author: $)

Constructor Summary
ExceptionUtil()
           
 
Method Summary
static
<E extends java.lang.Throwable>
void
unwrapIf(java.lang.RuntimeException e, java.lang.Class<E> unwrapIf)
          Given a RuntimeException, this method will - throw its cause exception, if the cause exception is an instance of the type of the unwrapIf parameter - throw its cause exception, if the cause exception is a RuntimeException - throw the given RuntimeException otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionUtil

public ExceptionUtil()
Method Detail

unwrapIf

public static <E extends java.lang.Throwable> void unwrapIf(java.lang.RuntimeException e,
                                                            java.lang.Class<E> unwrapIf)
                     throws E extends java.lang.Throwable
Given a RuntimeException, this method will - throw its cause exception, if the cause exception is an instance of the type of the unwrapIf parameter - throw its cause exception, if the cause exception is a RuntimeException - throw the given RuntimeException otherwise.

Throws:
E extends java.lang.Throwable


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.