public final class ThrowableUtil
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static void |
addSuppressed(java.lang.Throwable target,
java.util.List<java.lang.Throwable> suppressed) |
static void |
addSuppressed(java.lang.Throwable target,
java.lang.Throwable suppressed) |
static void |
addSuppressedAndClear(java.lang.Throwable target,
java.util.List<java.lang.Throwable> suppressed) |
static boolean |
haveSuppressed() |
static java.lang.String |
stackTraceToString(java.lang.Throwable cause)
Gets the stack trace from a Throwable as a String.
|
static <T extends java.lang.Throwable> |
unknownStackTrace(T cause,
java.lang.Class<?> clazz,
java.lang.String method)
Set the
StackTraceElement for the given Throwable , using the Class and method name. |
public static <T extends java.lang.Throwable> T unknownStackTrace(T cause, java.lang.Class<?> clazz, java.lang.String method)
StackTraceElement
for the given Throwable
, using the Class
and method name.public static java.lang.String stackTraceToString(java.lang.Throwable cause)
cause
- the Throwable
to be examinedThrowable.printStackTrace(java.io.PrintWriter)
method.public static boolean haveSuppressed()
public static void addSuppressed(java.lang.Throwable target, java.lang.Throwable suppressed)
public static void addSuppressedAndClear(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed)
public static void addSuppressed(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed)