Class ClassLoaderOrder
java.lang.Object
nonapi.io.github.classgraph.classpath.ClassLoaderOrder
A class to find all unique classloaders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<ClassLoader>The set of allClassLoaderinstances that have been added to the order so far, so that classloaders don't get added twice.private final Set<ClassLoader>The set of all parentClassLoaderinstances that have been delegated to so far, to enableClassGraph.ignoreParentClassLoaders().private final Map<ClassLoader,List<ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> TheClassLoaderorder.private final Set<ClassLoader>The set of allClassLoaderinstances that have been delegated to so far, to prevent an infinite loop in delegation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ClassLoader classLoader, LogNode log) Add aClassLoaderto the ClassLoader order at the current position.voiddelegateTo(ClassLoader classLoader, boolean isParent, LogNode log) Recursively delegate to anotherClassLoader.Get the all parent classloaders.private static List<ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>getClassLoaderHandlerRegistryEntries(ClassLoader classLoader, LogNode log) Get the ClassLoaderHandler(s) that can handle a given ClassLoader.Get theClassLoaderorder.
-
Field Details
-
classLoaderOrder
private final Map<ClassLoader,List<ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> classLoaderOrderTheClassLoaderorder. -
reflectionUtils
-
added
The set of allClassLoaderinstances that have been added to the order so far, so that classloaders don't get added twice. -
delegatedTo
The set of allClassLoaderinstances that have been delegated to so far, to prevent an infinite loop in delegation. -
allParentClassLoaders
The set of all parentClassLoaderinstances that have been delegated to so far, to enableClassGraph.ignoreParentClassLoaders().
-
-
Constructor Details
-
ClassLoaderOrder
-
-
Method Details
-
getClassLoaderOrder
public List<Map.Entry<ClassLoader,List<ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>>> getClassLoaderOrder()Get theClassLoaderorder.- Returns:
- the
ClassLoaderorder, as a pair:ClassLoader,ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry.
-
getAllParentClassLoaders
Get the all parent classloaders.- Returns:
- all parent classloaders
-
getClassLoaderHandlerRegistryEntries
private static List<ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry> getClassLoaderHandlerRegistryEntries(ClassLoader classLoader, LogNode log) Get the ClassLoaderHandler(s) that can handle a given ClassLoader. -
add
Add aClassLoaderto the ClassLoader order at the current position.- Parameters:
classLoader- the class loaderlog- the log
-
delegateTo
Recursively delegate to anotherClassLoader.- Parameters:
classLoader- the class loaderisParent- true if this is a parent of another classloaderlog- the log
-