public class StackTraceUtil extends java.lang.Object
StackTraceElement corresponding to a
calling method in the caller stack.| Modifier and Type | Method and Description |
|---|---|
static java.lang.StackTraceElement |
getCurrentMethodStackTraceElement()
Returns the stack trace element corresponding to the direct caller
method, that is, the method which calls this method.
|
static java.lang.StackTraceElement |
getCurrentMethodStackTraceElement(int callerOffset)
Returns the stack trace element belonging to the
callerOffsetth caller of the calling method. |
public static java.lang.StackTraceElement getCurrentMethodStackTraceElement()
public static java.lang.StackTraceElement getCurrentMethodStackTraceElement(int callerOffset)
callerOffsetth caller of the calling method.
For example, callerOffset=0 returns the stack trace element of
the direct caller of this method; callerOffset=1 corresponds to
the method calling the direct caller method, etc.
callerOffset - the index of the stack trace element in the caller stack,
where callerOffset=0 corresponds to the direct caller
of this methodCopyright © 2021. All Rights Reserved.