Class ClasspathFinder
- java.lang.Object
-
- nonapi.io.github.classgraph.classpath.ClasspathFinder
-
public class ClasspathFinder extends java.lang.Object
A class to find the unique ordered classpath elements.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoader[]
classLoaderOrderRespectingParentDelegation
The default order in which ClassLoaders are called to load classes, respecting parent-first/parent-last delegation order.private ClasspathOrder
classpathOrder
The classpath order.private ClassGraphClassLoader
delegateClassGraphClassLoader
If one of the classloaders that was found was an existing instance ofClassGraphClassLoader
, then delegate to that classloader first rather than trying to load from theClassGraphClassLoader
of the current scan, so that classes are compatible between nested scans (#485).private ModuleFinder
moduleFinder
TheModuleFinder
, if modules are to be scanned.
-
Constructor Summary
Constructors Constructor Description ClasspathFinder(ScanSpec scanSpec, ReflectionUtils reflectionUtils, LogNode log)
A class to find the unique ordered classpath elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoader[]
getClassLoaderOrderRespectingParentDelegation()
Get the ClassLoader order, respecting parent-first/parent-last delegation order.ClasspathOrder
getClasspathOrder()
Get the classpath order.ClassGraphClassLoader
getDelegateClassGraphClassLoader()
If one of the classloaders that was found was an existing instance ofClassGraphClassLoader
, then delegate to that classloader first rather than trying to load from theClassGraphClassLoader
of the current scan, so that classes are compatible between nested scans (#485).ModuleFinder
getModuleFinder()
Get theModuleFinder
.
-
-
-
Field Detail
-
classpathOrder
private final ClasspathOrder classpathOrder
The classpath order.
-
moduleFinder
private final ModuleFinder moduleFinder
TheModuleFinder
, if modules are to be scanned.
-
classLoaderOrderRespectingParentDelegation
private java.lang.ClassLoader[] classLoaderOrderRespectingParentDelegation
The default order in which ClassLoaders are called to load classes, respecting parent-first/parent-last delegation order.
-
delegateClassGraphClassLoader
private ClassGraphClassLoader delegateClassGraphClassLoader
If one of the classloaders that was found was an existing instance ofClassGraphClassLoader
, then delegate to that classloader first rather than trying to load from theClassGraphClassLoader
of the current scan, so that classes are compatible between nested scans (#485).
-
-
Constructor Detail
-
ClasspathFinder
public ClasspathFinder(ScanSpec scanSpec, ReflectionUtils reflectionUtils, LogNode log)
A class to find the unique ordered classpath elements.- Parameters:
scanSpec
- TheScanSpec
.log
- The log.
-
-
Method Detail
-
getClasspathOrder
public ClasspathOrder getClasspathOrder()
Get the classpath order.- Returns:
- The order of raw classpath elements obtained from ClassLoaders.
-
getModuleFinder
public ModuleFinder getModuleFinder()
Get theModuleFinder
.- Returns:
- The
ModuleFinder
.
-
getClassLoaderOrderRespectingParentDelegation
public java.lang.ClassLoader[] getClassLoaderOrderRespectingParentDelegation()
Get the ClassLoader order, respecting parent-first/parent-last delegation order.- Returns:
- the class loader order.
-
getDelegateClassGraphClassLoader
public ClassGraphClassLoader getDelegateClassGraphClassLoader()
If one of the classloaders that was found was an existing instance ofClassGraphClassLoader
, then delegate to that classloader first rather than trying to load from theClassGraphClassLoader
of the current scan, so that classes are compatible between nested scans (#485).- Returns:
- the
ClassGraphClassLoader
to delegate to before loading classes with this scan's ownClassGraphClassLoader
(or null if none).
-
-