Package de.uplanet.util
Klasse ExceptionUtil
java.lang.Object
de.uplanet.util.ExceptionUtil
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <T extends Throwable>
TgetCauseOfType(Throwable p_e, Class<T> p_clsException) Get the first cause of the given type.static ThrowablegetCauseOfType(Throwable p_e, String p_strExceptionClass) Get the first cause of the given type.static ThrowablegetRootCause(Throwable p_e) Get the root cause of an exception.static StringgetStackTrace(Throwable p_e) Get the stack trace of the given exception as a string.static booleanisCausedBy(Throwable p_e, Class<? extends Throwable> p_clsException) Check if the given exception is caused by an exception of the given type.static booleanisCausedBy(Throwable p_e, String p_strExceptionClass) Check if the given exception is caused by an exception of the given type.static booleanCheck if the given exception is caused by ajava.security.AccessControlException.static <T extends Throwable>
TprefixMessage(T p_e, String p_strPrefix) Veraltet.Since Intrexx 11.8.0.
-
Methodendetails
-
isCausedBy
public static boolean isCausedBy(Throwable p_e, String p_strExceptionClass) throws ClassNotFoundException Check if the given exception is caused by an exception of the given type.- Parameter:
p_e- The exception.p_strExceptionClass- The type of the exception.- Gibt zurück:
trueif the given exception is caused by an exception of the given type, orfalseotherwise.- Löst aus:
ClassNotFoundException- - Ifp_strExceptionClassis not found.- Siehe auch:
-
isCausedBy
Check if the given exception is caused by an exception of the given type.- Parameter:
p_e- The exception.p_clsException- The type of the exception.- Gibt zurück:
trueif the given exception is caused by an exception of the given type, orfalseotherwise.- Siehe auch:
-
getCauseOfType
public static Throwable getCauseOfType(Throwable p_e, String p_strExceptionClass) throws ClassNotFoundException Get the first cause of the given type.- Parameter:
p_e- The exception.p_strExceptionClass- The type of the exception.- Gibt zurück:
- The first cause of the exception of the given type, or
nullif no such cause could be found. - Löst aus:
ClassNotFoundException- - Ifp_strExceptionClassis not found.
-
getCauseOfType
Get the first cause of the given type.- Parameter:
p_e- The exception.p_clsException- The type of the exception.- Gibt zurück:
- The first cause of the exception of the given type, or
nullif no such cause could be found.
-
isCausedByAccessControlException
Check if the given exception is caused by ajava.security.AccessControlException.- Gibt zurück:
trueif the give exception is caused by ajava.security.AccessControlException, orfalseotherwise.
-
getRootCause
Get the root cause of an exception.- Parameter:
p_e- The exception.- Gibt zurück:
- The root cause, or
p_eif no cause exists.
-
prefixMessage
Veraltet.Since Intrexx 11.8.0.Try to prefix the given exception's message with the given prefix, which always fails.Under normal circumstances exceptions should be wrapped as the cause of newly thrown exceptions. So use this method sparingly.
- Parameter:
p_e- The exception.p_strPrefix- The prefix.- Gibt zurück:
- The given exception.
-
getStackTrace
Get the stack trace of the given exception as a string.- Parameter:
p_e- The exception.- Gibt zurück:
- The stack trace.
-