Package org.apache.wicket.util.lang
Class Exceptions
- java.lang.Object
-
- org.apache.wicket.util.lang.Exceptions
-
public class Exceptions extends Object
- Author:
- igor.vaynberg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceExceptions.IThrowableVisitor<T>Visitor used to visitThrowablechainsstatic classExceptions.Visit<T>Represents a visit
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends Throwable>
TfindCause(Throwable throwable, Class<T> causeType)Looks for a cause of the specified type in throwable's chainThrowablegetRootCause(Throwable throwable)Gets root cause of the throwablestatic <T> Tvisit(Throwable throwable, Exceptions.IThrowableVisitor<T> visitor)Visits theThrowable's chain
-
-
-
Method Detail
-
getRootCause
public Throwable getRootCause(Throwable throwable)
Gets root cause of the throwable- Parameters:
throwable-- Returns:
- root cause
-
findCause
public static <T extends Throwable> T findCause(Throwable throwable, Class<T> causeType)
Looks for a cause of the specified type in throwable's chain- Type Parameters:
T-- Parameters:
throwable-causeType-- Returns:
- matched
Throwablein the chain ornullif none
-
visit
public static <T> T visit(Throwable throwable, Exceptions.IThrowableVisitor<T> visitor)
Visits theThrowable's chain- Type Parameters:
T-- Parameters:
throwable-visitor-- Returns:
- result set on visitor or
nullif none
-
-