Package io.github.classgraph
Class ClassGraphClassLoader
java.lang.Object
java.lang.ClassLoader
io.github.classgraph.ClassGraphClassLoader
ClassLoader
for classes found by ClassGraph during scanning.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Set
<ClassLoader> The ordered set of overridden or added classloaders to try delegating to.private final ClassLoader
AURLClassLoader
consisting of URLs on the classpath.private Set
<ClassLoader> The ordered set of environment classloaders to try delegating to.private final boolean
Whether or not to initialize loaded classes.private List
<ClassLoader> Any override classloader(s).private final ScanResult
The scan result. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Class
<?> getResource
(String path) getResourceAsStream
(String path) getResources
(String path) URL[]
getURLs()
Get classpath URLs.Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
scanResult
The scan result. -
initializeLoadedClasses
private final boolean initializeLoadedClassesWhether or not to initialize loaded classes. -
environmentClassLoaderDelegationOrder
The ordered set of environment classloaders to try delegating to. -
overrideClassLoaders
Any override classloader(s). -
classpathClassLoader
AURLClassLoader
consisting of URLs on the classpath. -
addedClassLoaderDelegationOrder
The ordered set of overridden or added classloaders to try delegating to.
-
-
Constructor Details
-
ClassGraphClassLoader
ClassGraphClassLoader(ScanResult scanResult) Constructor.- Parameters:
scanResult
- The ScanResult.
-
-
Method Details
-
findClass
protected Class<?> findClass(String className) throws ClassNotFoundException, LinkageError, SecurityException - Overrides:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
LinkageError
SecurityException
-
getURLs
Get classpath URLs.- Returns:
- The classpath URLs in the
ScanResult
handled by thisClassLoader
.
-
getResource
- Overrides:
getResource
in classClassLoader
-
getResources
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
getResourceAsStream
- Overrides:
getResourceAsStream
in classClassLoader
-