Class ClasspathFinder

java.lang.Object
nonapi.io.github.classgraph.classpath.ClasspathFinder

public class ClasspathFinder extends Object
A class to find the unique ordered classpath elements.
  • Field Details

    • classpathOrder

      private final ClasspathOrder classpathOrder
      The classpath order.
    • moduleFinder

      private final ModuleFinder moduleFinder
      The ModuleFinder, if modules are to be scanned.
    • classLoaderOrderRespectingParentDelegation

      private 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 of ClassGraphClassLoader, then delegate to that classloader first rather than trying to load from the ClassGraphClassLoader of the current scan, so that classes are compatible between nested scans (#485).
  • Constructor Details

    • ClasspathFinder

      public ClasspathFinder(ScanSpec scanSpec, ReflectionUtils reflectionUtils, LogNode log)
      A class to find the unique ordered classpath elements.
      Parameters:
      scanSpec - The ScanSpec.
      log - The log.
  • Method Details

    • getClasspathOrder

      public ClasspathOrder getClasspathOrder()
      Get the classpath order.
      Returns:
      The order of raw classpath elements obtained from ClassLoaders.
    • getModuleFinder

      public ModuleFinder getModuleFinder()
      Get the ModuleFinder.
      Returns:
      The ModuleFinder.
    • getClassLoaderOrderRespectingParentDelegation

      public 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 of ClassGraphClassLoader, then delegate to that classloader first rather than trying to load from the ClassGraphClassLoader 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 own ClassGraphClassLoader (or null if none).