Package org.scijava.log
Class CallingClassUtils
- java.lang.Object
-
- org.scijava.log.CallingClassUtils
-
public final class CallingClassUtils extends Object
Utility class for getting the calling class of a method.- Author:
- Matthias Arzt
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Class<?>getCallingClass()Deprecated.UsegetCallingClassName()instead.static StringgetCallingClassName()Inspects the stack trace to return the name of the class that calls this method, but ignores every class annotated with @IgnoreAsCallingClass.
-
-
-
Method Detail
-
getCallingClassName
public 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.If every class on the stack trace is annotated, then the class at the root of the stack trace is returned.
-
getCallingClass
@Deprecated public static Class<?> getCallingClass()
Deprecated.UsegetCallingClassName()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.- Throws:
IllegalStateException- if every method on the stack, is in a class annotated with @IgnoreAsCallingClass.
-
-