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

public Class ClassLoaderOrder

extends Object
Class Inheritance
Imports
java.util.AbstractMap.SimpleEntry, .ArrayList, .Collections, .IdentityHashMap, .List, .Map, .Map.Entry, .Set, io.github.classgraph.ClassGraph, nonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandler, .ClassLoaderHandlerRegistry, .ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry, nonapi.io.github.classgraph.reflection.ReflectionUtils, nonapi.io.github.classgraph.utils.LogNode

A class to find all unique classloaders.

Field Summary

Modifier and TypeField and Description
private final Set<ClassLoader>
added

The set of all ClassLoader instances that have been added to the order so far, so that classloaders don't get added twice.

private final Set<ClassLoader>
allParentClassLoaders

The set of all parent ClassLoader instances that have been delegated to so far, to enable ClassGraph#ignoreParentClassLoaders().

private final List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>>
private final Map<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>
private final Set<ClassLoader>
delegatedTo

The set of all ClassLoader instances that have been delegated to so far, to prevent an infinite loop in delegation.

public ReflectionUtils

Constructor Summary

AccessConstructor and Description
public
ClassLoaderOrder(final ReflectionUtils reflectionUtils)

Method Summary

Modifier and TypeMethod and Description
public void
add(final ClassLoader
the class loader
classLoader
,
final LogNode
the log
log
)

Add a ClassLoader to the ClassLoader order at the current position.

public void
delegateTo(final ClassLoader
the class loader
classLoader
,
final boolean
true if this is a parent of another classloader
isParent
,
final LogNode
the log
log
)

Recursively delegate to another ClassLoader.

public Set<ClassLoader>

Returns:

all parent classloaders
getAllParentClassLoaders
()

Get the all parent classloaders.

public List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>>
private ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry
getRegistryEntry(final ClassLoader classLoader, final LogNode
the log
log
)

Find the ClassLoaderHandler that can handle a given ClassLoader instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addedback to summary
private final Set<ClassLoader> added

The set of all ClassLoader instances that have been added to the order so far, so that classloaders don't get added twice.

allParentClassLoadersback to summary
private final Set<ClassLoader> allParentClassLoaders

The set of all parent ClassLoader instances that have been delegated to so far, to enable ClassGraph#ignoreParentClassLoaders().

classLoaderOrderback to summary
private final List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> classLoaderOrder

The ClassLoader order.

classLoaderToClassLoaderHandlerRegistryEntryback to summary
private final Map<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry> classLoaderToClassLoaderHandlerRegistryEntry

A map from ClassLoader to ClassLoaderHandlerRegistryEntry.

delegatedToback to summary
private final Set<ClassLoader> delegatedTo

The set of all ClassLoader instances that have been delegated to so far, to prevent an infinite loop in delegation.

reflectionUtilsback to summary
public ReflectionUtils reflectionUtils

Constructor Detail

ClassLoaderOrderback to summary
public ClassLoaderOrder(final ReflectionUtils reflectionUtils)

Method Detail

addback to summary
public void add(final ClassLoader classLoader, final LogNode log)

Add a ClassLoader to the ClassLoader order at the current position.

Parameters
classLoader:ClassLoader

the class loader

log:LogNode

the log

delegateToback to summary
public void delegateTo(final ClassLoader classLoader, final boolean isParent, final LogNode log)

Recursively delegate to another ClassLoader.

Parameters
classLoader:ClassLoader

the class loader

isParent:boolean

true if this is a parent of another classloader

log:LogNode

the log

getAllParentClassLoadersback to summary
public Set<ClassLoader> getAllParentClassLoaders()

Get the all parent classloaders.

Returns:Set<ClassLoader>

all parent classloaders

getClassLoaderOrderback to summary
public List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> getClassLoaderOrder()

Get the ClassLoader order.

Returns:List<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>>

the ClassLoader order, as a pair: ClassLoader, ClassLoaderHandlerRegistryEntry.

getRegistryEntryback to summary
private ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry getRegistryEntry(final ClassLoader classLoader, final LogNode log)

Find the ClassLoaderHandler that can handle a given ClassLoader instance.

Parameters
classLoader:ClassLoader

the ClassLoader.

log:LogNode

the log

Returns:ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry

the ClassLoaderHandlerRegistryEntry for the ClassLoader.