Top Description Fields Constructors Methods
nonapi.io.github.classgraph.classpath

pack-priv Class CallStackReader

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .InvocationHandler, .Method, .Proxy, java.util.ArrayList, .List, java.util.concurrent.Callable, nonapi.io.github.classgraph.reflection.ReflectionUtils, nonapi.io.github.classgraph.utils.LogNode, .VersionFinder

A class to find the unique ordered classpath elements.

Field Summary

Modifier and TypeField and Description
pack-priv ReflectionUtils

Constructor Summary

AccessConstructor and Description
public
CallStackReader(final ReflectionUtils reflectionUtils)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private static Class<?>[]

Returns:

the call stack.
getCallStackViaSecurityManager
(final LogNode
the log
log
)

Get the call stack via the SecurityManager.getClassContext() native method.

private static Class<?>[]

Returns:

the call stack, or null if it could not be obtained.
getCallStackViaStackWalker
()

Get the call stack via the StackWalker API (JRE 9+).

pack-priv Class<?>[]

Returns:

The classes in the call stack.
getClassContext
(final LogNode
the log
log
)

Get the class context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

reflectionUtilsback to summary
pack-priv ReflectionUtils reflectionUtils

Constructor Detail

CallStackReaderback to summary
public CallStackReader(final ReflectionUtils reflectionUtils)

Constructor.

Method Detail

getCallStackViaSecurityManagerback to summary
private static Class<?>[] getCallStackViaSecurityManager(final LogNode log)

Get the call stack via the SecurityManager.getClassContext() native method.

Parameters
log:LogNode

the log

Returns:Class<?>[]

the call stack.

getCallStackViaStackWalkerback to summary
private static Class<?>[] getCallStackViaStackWalker()

Get the call stack via the StackWalker API (JRE 9+).

Returns:Class<?>[]

the call stack, or null if it could not be obtained.

getClassContextback to summary
pack-priv Class<?>[] getClassContext(final LogNode log)

Get the class context.

Parameters
log:LogNode

the log

Returns:Class<?>[]

The classes in the call stack.