|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.ExceptionUtil
public final class ExceptionUtil
The ExceptionUtil provides common functionality for working with and
processing exceptions.
| Method Summary | ||
|---|---|---|
static boolean |
contains(Throwable pThrowable,
Class<? extends Throwable> pClass)
Gets whether the Throwable from the chain contains a
Throwable that the given Class is assignable from. |
|
static String |
dump(Throwable pCause,
boolean pDeep)
Writes the Throwable and its stacktrace into a String. |
|
static List<String> |
getMessages(Throwable pThrowable)
Gets all messages in the chain starting with pThrowable. |
|
static String |
getMessages(Throwable pThrowable,
String pSeparator)
Gets all messages in the chain starting with pThrowable
concatenated into a String with the given separator. |
|
static Throwable |
getRootCause(Throwable pThrowable)
Gets the root cause of the given
Throwable. |
|
static
|
getThrowable(Throwable pThrowable,
Class<T> pClass)
Gets the Throwable from the chain that the given Class is
assignable from. |
|
static List<Throwable> |
getThrowables(Throwable pThrowable)
Gets a List of all Throwables and
causes including pThrowable as first
element. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean contains(Throwable pThrowable,
Class<? extends Throwable> pClass)
Throwable from the chain contains a
Throwable that the given Class is assignable from.
pThrowable - the Throwable from which to start.pClass - the Class of the Throwable that you're
looking for.
true if there is an Throwable in the chain which
matches the given type.getThrowable(Throwable, Class),
Class.isAssignableFrom(Class)
public static String dump(Throwable pCause,
boolean pDeep)
Throwable and its stacktrace into a String. If
pDeep is true also all causes will be written.
pCause - the Throwable to dump.pDeep - true to dump given Throwable and all
causes, false to only
dump the given Throwable.
Throwable.public static List<String> getMessages(Throwable pThrowable)
pThrowable.
pThrowable - the Throwable at which to start.
List of messages.
public static String getMessages(Throwable pThrowable,
String pSeparator)
pThrowable
concatenated into a String with the given separator.
pThrowable - the Throwable at which to start.pSeparator - the separator to use.
getMessages(Throwable),
StringUtil.concat(String, String...)public static Throwable getRootCause(Throwable pThrowable)
root cause of the given
Throwable.
pThrowable - the Throwable of which to get the
root cause.
root cause of the given
Throwable. null if pThrowable is
null. pThrowable is returned if it does not have
a cause.
public static <T extends Throwable> T getThrowable(Throwable pThrowable,
Class<T> pClass)
Throwable from the chain that the given Class is
assignable from.
T - the type of the Throwable.pThrowable - the Throwable from which to start.pClass - the Class of the Throwable that you're
looking for.
Throwable from the chain that is assignable from the
given Class.contains(Throwable, Class),
Class.isAssignableFrom(Class)public static List<Throwable> getThrowables(Throwable pThrowable)
List of all Throwables and
causes including pThrowable as first
element.
pThrowable - the Throwable of which to get all
causes.
List of all Throwables and
causes including pThrowable
as first element.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||