com.bigdata.util
Class InnerCause

java.lang.Object
  extended by com.bigdata.util.InnerCause

public class InnerCause
extends Object

Utility class declaring methods for examining a stack trace for an instance of some class of exception.

Version:
$Id: InnerCause.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
InnerCause()
           
 
Method Summary
static Throwable getInnerCause(Throwable t, Class<? extends Throwable> cls)
          Examines a stack trace for an instance of the specified cause nested to any level within that stack trace.
static boolean isInnerCause(Throwable t, Class<? extends Throwable> cls)
          Examines a stack trace for an instance of the specified cause nested to any level within that stack trace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InnerCause

public InnerCause()
Method Detail

getInnerCause

public static Throwable getInnerCause(Throwable t,
                                      Class<? extends Throwable> cls)
Examines a stack trace for an instance of the specified cause nested to any level within that stack trace.

Parameters:
t - The stack trace.
cls - The class of exception that you are looking for in the stack trace.
Returns:
An exception that is an instance of that class iff one exists in the stack trace and null otherwise.
Throws:
IllegalArgumentException - if any parameter is null.

isInnerCause

public static boolean isInnerCause(Throwable t,
                                   Class<? extends Throwable> cls)
Examines a stack trace for an instance of the specified cause nested to any level within that stack trace.

Parameters:
t - The stack trace.
cls - The class of exception that you are looking for in the stack trace.
Returns:
true iff an exception that is an instance of that class iff one exists in the stack trace.
Throws:
IllegalArgumentException - if any parameter is null.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.