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 List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> TheClassLoaderorder.private final Map<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry> 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.Get theClassLoaderorder.getRegistryEntry(ClassLoader classLoader, LogNode log) Find theClassLoaderHandlerthat can handle a givenClassLoaderinstance.
-
Field Details
-
classLoaderOrder
private final List<Map.Entry<ClassLoader, 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(). -
classLoaderToClassLoaderHandlerRegistryEntry
private final Map<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry> classLoaderToClassLoaderHandlerRegistryEntry
-
-
Constructor Details
-
ClassLoaderOrder
-
-
Method Details
-
getClassLoaderOrder
public List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> getClassLoaderOrder()Get theClassLoaderorder.- Returns:
- the
ClassLoaderorder, as a pair:ClassLoader,ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry.
-
getAllParentClassLoaders
Get the all parent classloaders.- Returns:
- all parent classloaders
-
getRegistryEntry
private ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry getRegistryEntry(ClassLoader classLoader, LogNode log) Find theClassLoaderHandlerthat can handle a givenClassLoaderinstance.- Parameters:
classLoader- theClassLoader.log- the log- Returns:
- the
ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntryfor theClassLoader.
-
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
-