public final class StackLocatorUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static StackTraceElement |
calcLocation(String fqcnOfLogger) |
static Class<?> |
getCallerClass(Class<?> anchor) |
static Class<?> |
getCallerClass(Class<?> sentinelClass,
Predicate<Class<?>> callerPredicate)
Search for a calling class.
|
static Class<?> |
getCallerClass(int depth) |
static Class<?> |
getCallerClass(String fqcn)
Equivalent to
getCallerClass(String, String) with an empty pkg. |
static Class<?> |
getCallerClass(String fqcn,
String pkg)
Search for a calling class.
|
static Stack<Class<?>> |
getCurrentStackTrace() |
static StackTraceElement |
getStackTraceElement(int depth) |
public static Class<?> getCallerClass(int depth)
public static StackTraceElement getStackTraceElement(int depth)
public static Class<?> getCallerClass(String fqcn)
getCallerClass(String, String) with an empty pkg.public static Class<?> getCallerClass(String fqcn, String pkg)
fqcn - Root class name whose caller to search for.pkg - Package name prefix that must be matched after the fqcn has been found.public static Class<?> getCallerClass(Class<?> sentinelClass, Predicate<Class<?>> callerPredicate)
sentinelClass - Sentinel class at which to begin searchingcallerPredicate - Predicate checked after the sentinelClass is foundsentinelClass is found.public static StackTraceElement calcLocation(String fqcnOfLogger)
Copyright © 2006–2022 OPS4J - Open Participation Software for Java. All rights reserved.