Class ClasspathElementModule

java.lang.Object
io.github.classgraph.ClasspathElement
io.github.classgraph.ClasspathElementModule
All Implemented Interfaces:
Comparable<ClasspathElement>

class ClasspathElementModule extends ClasspathElement
A module classpath element.
  • Field Details

  • Constructor Details

  • Method Details

    • open

      void open(WorkQueue<Scanner.ClasspathEntryWorkUnit> workQueueIgnored, LogNode log) throws InterruptedException
      Description copied from class: ClasspathElement
      Determine if this classpath element is valid. If it is not valid, sets skipClasspathElement. For ClasspathElementZip, may also open or extract inner jars, and also causes jarfile manifests to be read to look for Class-Path entries. If nested jars or Class-Path entries are found, they are added to the work queue. This method is only run once per classpath element, from a single thread.
      Specified by:
      open in class ClasspathElement
      Parameters:
      workQueueIgnored - the work queue
      log - the log
      Throws:
      InterruptedException - if the thread was interrupted while trying to open the classpath element.
    • newResource

      private Resource newResource(String resourcePath)
      Create a new Resource object for a resource or classfile discovered while scanning paths.
      Parameters:
      resourcePath - the resource path
      Returns:
      the resource
    • getResource

      Resource getResource(String relativePath)
      Get the Resource for a given relative path.
      Specified by:
      getResource in class ClasspathElement
      Parameters:
      relativePath - The relative path of the Resource to return.
      Returns:
      The Resource for the given relative path, or null if relativePath does not exist in this classpath element.
    • scanPaths

      void scanPaths(LogNode log)
      Scan for package matches within module.
      Specified by:
      scanPaths in class ClasspathElement
      Parameters:
      log - the log
    • getModuleRef

      ModuleRef getModuleRef()
      Get the ModuleRef for this classpath element.
      Returns:
      the module ref
    • getModuleName

      public String getModuleName()
      Get the module name from the module reference or the module descriptor.
      Specified by:
      getModuleName in class ClasspathElement
      Returns:
      the module name, or null if the module does not have a name.
    • getModuleNameOrEmpty

      private String getModuleNameOrEmpty()
      Get the module name from the module reference or the module descriptor.
      Returns:
      the module name, or the empty string if the module does not have a name.
    • getURI

      URI getURI()
      Description copied from class: ClasspathElement
      Get the URI for this classpath element.
      Specified by:
      getURI in class ClasspathElement
      Returns:
      the URI for the classpath element.
    • getAllURIs

      List<URI> getAllURIs()
      Description copied from class: ClasspathElement
      Get the URI for this classpath element, and the URIs for any automatic nested package prefixes (e.g. "spring-boot.jar/BOOT-INF/classes") within this jarfile.
      Specified by:
      getAllURIs in class ClasspathElement
      Returns:
      the URI for the classpath element.
    • getFile

      File getFile()
      Description copied from class: ClasspathElement
      Get the file for this classpath element, or null if this is a module with a "jrt:" URI.
      Specified by:
      getFile in class ClasspathElement
      Returns:
      the file for the classpath element.
    • toString

      public String toString()
      Return the module reference as a String.
      Overrides:
      toString in class Object
      Returns:
      the string
    • equals

      public boolean equals(Object obj)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      obj - the obj
      Returns:
      true, if successful
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int