public final class CallingClassUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Class<?> |
getCallingClass()
Deprecated.
Use
getCallingClassName() instead.
Warning: This method throws a IllegalStateException as soon as it comes
across a class that can't be loaded with the default class loader.
Inspects the stack trace to return the class that calls this method, but
ignores every class annotated with @IgnoreAsCallingClass. |
static String |
getCallingClassName()
Inspects the stack trace to return the name of the class that calls
this method, but ignores every class annotated with @IgnoreAsCallingClass.
|
public static String getCallingClassName()
If every class on the stack trace is annotated, then the class at the root of the stack trace is returned.
@Deprecated public static Class<?> getCallingClass()
getCallingClassName()
instead.
Warning: This method throws a IllegalStateException as soon as it comes
across a class that can't be loaded with the default class loader.
Inspects the stack trace to return the class that calls this method, but
ignores every class annotated with @IgnoreAsCallingClass.IllegalStateException
- if every method on the stack, is in a class
annotated with @IgnoreAsCallingClass.Copyright © 2015–2022 SciJava. All rights reserved.