org.loom.util
Class ExceptionUtils

java.lang.Object
  extended by org.loom.util.ExceptionUtils

public class ExceptionUtils
extends java.lang.Object


Constructor Summary
ExceptionUtils()
           
 
Method Summary
static java.lang.Throwable getNestedException(java.lang.Throwable e)
          Return a reasonable guess about the exception cause, removing any exception that is only meant as a wrapper
static
<T extends java.lang.Throwable>
T
getNestedExceptionWithClass(java.lang.Throwable e, java.lang.Class<T> expectedClass)
          Return the nested exception with the expected exception class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionUtils

public ExceptionUtils()
Method Detail

getNestedException

public static java.lang.Throwable getNestedException(java.lang.Throwable e)
Return a reasonable guess about the exception cause, removing any exception that is only meant as a wrapper


getNestedExceptionWithClass

public static <T extends java.lang.Throwable> T getNestedExceptionWithClass(java.lang.Throwable e,
                                                                            java.lang.Class<T> expectedClass)
Return the nested exception with the expected exception class

Parameters:
e - the exception to start the search
expectedClass - the expected class.
Returns:
the nested exception with the expected class, null if none