|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.omnifaces.util.Exceptions
public final class Exceptions
Collection of general utility methods with respect to working with exceptions.
Method Summary | ||
---|---|---|
static
|
is(java.lang.Throwable exception,
java.lang.Class<T> type)
Returns true if the given exception or one of its nested causes is an instance of the given type. |
|
static
|
unwrap(java.lang.Throwable exception)
Unwrap the nested causes of given exception as long as until it is not an instance of FacesException
(Mojarra) or ELException (MyFaces) and then return it. |
|
static
|
unwrap(java.lang.Throwable exception,
java.lang.Class<T> type)
Unwrap the nested causes of given exception as long as until it is not an instance of the given type and then return it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T extends java.lang.Throwable> java.lang.Throwable unwrap(java.lang.Throwable exception, java.lang.Class<T> type)
ServletException
or FacesException
.
exception
- The exception to be unwrapped.type
- The type which needs to be unwrapped.
public static <T extends java.lang.Throwable> java.lang.Throwable unwrap(java.lang.Throwable exception)
FacesException
(Mojarra) or ELException
(MyFaces) and then return it. If the given exception is already not an instance
of the mentioned types, then it will directly be returned. Or if the exception, unwrapped or not, does not have
a nested cause anymore, then it will be returned.
exception
- The exception to be unwrapped from FacesException
and ELException
.
public static <T extends java.lang.Throwable> boolean is(java.lang.Throwable exception, java.lang.Class<T> type)
true
if the given exception or one of its nested causes is an instance of the given type.
exception
- The exception to be checked.type
- The type to be compared to.
true
if the given exception or one of its nested causes is an instance of the given type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |