org.apache.wicket.util.lang
Class Exceptions

java.lang.Object
  extended by org.apache.wicket.util.lang.Exceptions

public class Exceptions
extends java.lang.Object

Author:
igor.vaynberg

Nested Class Summary
static interface Exceptions.IThrowableVisitor<T>
          Visitor used to visit Throwable chains
static class Exceptions.Visit<T>
          Represents a visit
 
Method Summary
static
<T extends java.lang.Throwable>
T
findCause(java.lang.Throwable throwable, java.lang.Class<T> causeType)
          Looks for a cause of the specified type in throwable's chain
 java.lang.Throwable getRootCause(java.lang.Throwable throwable)
          Gets root cause of the throwable
static
<T> T
visit(java.lang.Throwable throwable, Exceptions.IThrowableVisitor<T> visitor)
          Visits the Throwable's chain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRootCause

public java.lang.Throwable getRootCause(java.lang.Throwable throwable)
Gets root cause of the throwable

Parameters:
throwable -
Returns:
root cause

findCause

public static <T extends java.lang.Throwable> T findCause(java.lang.Throwable throwable,
                                                          java.lang.Class<T> causeType)
Looks for a cause of the specified type in throwable's chain

Type Parameters:
T -
Parameters:
throwable -
causeType -
Returns:
matched Throwable in the chain or null if none

visit

public static <T> T visit(java.lang.Throwable throwable,
                          Exceptions.IThrowableVisitor<T> visitor)
Visits the Throwable's chain

Type Parameters:
T -
Parameters:
throwable -
visitor -
Returns:
result set on visitor or null if none


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.