|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.ExceptionUtil
public final class ExceptionUtil
Static exception utiltity methods.
The methods of this class can be used to obtain exception messages and stack traces.
The account especially for nested exceptions, i. e. exceptions that are held not only
as exception cause (see Throwable.getCause()), but may also be returned
by one of the following methods, which will be accessed using reflections:
getException
getTargetException
getNestedException
| Method Summary | |
|---|---|
static java.lang.RuntimeException |
extractRuntimeException(java.lang.Throwable e)
Extracts a runtime exception from the given exception. |
static java.lang.Throwable |
findNestedException(java.lang.Throwable t,
java.lang.String className)
Recurses the exception chain down until the specified exception. |
static java.lang.Throwable |
getNestedException(java.lang.Throwable t)
Gets the target excpeption of a Throwable object or the object itself. |
static java.util.List |
getNestedExceptions(java.lang.Throwable throwable)
Gets a list containing the given throwable and all its nested exceptions. |
static java.lang.String |
getNestedMessage(java.lang.Throwable t)
Gets the exception message of the throwable plus any additional message of exceptions nested by this throwable. |
static java.lang.String |
getNestedTrace(java.lang.Throwable throwable)
Gets the stack trace of the throwable plus the stack traces of exceptions nested by this throwable. |
static void |
printTrace(java.lang.String msg,
java.lang.Throwable t)
Prints a nested stack trace of the given throwable to stderr. |
static void |
printTrace(java.lang.Throwable t)
Prints a nested stack trace of the given throwable to stderr. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String getNestedMessage(java.lang.Throwable t)
t - Throwable object
public static java.lang.String getNestedTrace(java.lang.Throwable throwable)
throwable - Throwable object
public static java.util.List getNestedExceptions(java.lang.Throwable throwable)
throwable - Throwable object
Throwable objects.public static java.lang.Throwable getNestedException(java.lang.Throwable t)
t - Throwable object
public static java.lang.Throwable findNestedException(java.lang.Throwable t,
java.lang.String className)
t - Throwable objectclassName - Fully qualified class name of the exception to search
public static void printTrace(java.lang.Throwable t)
t - Exception to print
public static void printTrace(java.lang.String msg,
java.lang.Throwable t)
msg - Additional explaining message that should preceede the stack trace or nullt - Exception to printpublic static java.lang.RuntimeException extractRuntimeException(java.lang.Throwable e)
e - Exception to inspect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||