Package io.github.classgraph
Class ClasspathElementModule
java.lang.Object
io.github.classgraph.ClasspathElement
io.github.classgraph.ClasspathElementModule
- All Implemented Interfaces:
Comparable<ClasspathElement>
A module classpath element.
-
Field Summary
FieldsModifier and TypeFieldDescriptionAll resource paths.private Recycler<ModuleReaderProxy, IOException> The module reader proxy recycler.(package private) final ModuleRefThe module ref.(package private) SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException> A singleton map from aModuleRefto aModuleReaderProxyrecycler for the module.Fields inherited from class io.github.classgraph.ClasspathElement
acceptedClassfileResources, acceptedResources, childClasspathElements, classLoader, classpathElementIdx, classpathElementIdxWithinParent, containsSpecificallyAcceptedClasspathElementResourcePath, fileToLastModified, moduleNameFromModuleDescriptor, nestedClasspathRootPrefixes, packageRootPrefix, scanned, scanResult, scanSpec, skipClasspathElement -
Constructor Summary
ConstructorsConstructorDescriptionClasspathElementModule(ModuleRef moduleRef, SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException> moduleRefToModuleReaderProxyRecyclerMap, Scanner.ClasspathEntryWorkUnit workUnit, ScanSpec scanSpec) A zip/jarfile classpath element. -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquals.Get the URI for this classpath element, and the URIs for any automatic nested package prefixes (e.g.(package private) FilegetFile()Get the file for this classpath element, or null if this is a module with a "jrt:" URI.Get the module name from the module reference or the module descriptor.private StringGet the module name from the module reference or the module descriptor.(package private) ModuleRefGet the ModuleRef for this classpath element.(package private) ResourcegetResource(String relativePath) Get theResourcefor a given relative path.(package private) URIgetURI()Get the URI for this classpath element.inthashCode()Hash code.private ResourcenewResource(String resourcePath) Create a newResourceobject for a resource or classfile discovered while scanning paths.(package private) voidopen(WorkQueue<Scanner.ClasspathEntryWorkUnit> workQueueIgnored, LogNode log) Determine if this classpath element is valid.(package private) voidScan for package matches within module.toString()Return the module reference as a String.Methods inherited from class io.github.classgraph.ClasspathElement
addAcceptedResource, checkResourcePathAcceptReject, compareTo, finishScanPaths, getClassLoader, getNumClassfileMatches, log, log, maskClassfiles, setScanResult
-
Field Details
-
moduleRef
The module ref. -
moduleRefToModuleReaderProxyRecyclerMap
SingletonMap<ModuleRef,Recycler<ModuleReaderProxy, moduleRefToModuleReaderProxyRecyclerMapIOException>, IOException> A singleton map from aModuleRefto aModuleReaderProxyrecycler for the module. -
moduleReaderProxyRecycler
The module reader proxy recycler. -
allResourcePaths
All resource paths.
-
-
Constructor Details
-
ClasspathElementModule
ClasspathElementModule(ModuleRef moduleRef, SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException> moduleRefToModuleReaderProxyRecyclerMap, Scanner.ClasspathEntryWorkUnit workUnit, ScanSpec scanSpec) A zip/jarfile classpath element.- Parameters:
moduleRef- the module refmoduleRefToModuleReaderProxyRecyclerMap- the module ref to module reader proxy recycler mapworkUnit- the work unitscanSpec- the scan spec
-
-
Method Details
-
open
void open(WorkQueue<Scanner.ClasspathEntryWorkUnit> workQueueIgnored, LogNode log) throws InterruptedException Description copied from class:ClasspathElementDetermine if this classpath element is valid. If it is not valid, sets skipClasspathElement. ForClasspathElementZip, 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:
openin classClasspathElement- Parameters:
workQueueIgnored- the work queuelog- the log- Throws:
InterruptedException- if the thread was interrupted while trying to open the classpath element.
-
newResource
Create a newResourceobject for a resource or classfile discovered while scanning paths.- Parameters:
resourcePath- the resource path- Returns:
- the resource
-
getResource
Get theResourcefor a given relative path.- Specified by:
getResourcein classClasspathElement- Parameters:
relativePath- The relative path of theResourceto return.- Returns:
- The
Resourcefor the given relative path, or null if relativePath does not exist in this classpath element.
-
scanPaths
Scan for package matches within module.- Specified by:
scanPathsin classClasspathElement- Parameters:
log- the log
-
getModuleRef
ModuleRef getModuleRef()Get the ModuleRef for this classpath element.- Returns:
- the module ref
-
getModuleName
Get the module name from the module reference or the module descriptor.- Specified by:
getModuleNamein classClasspathElement- Returns:
- the module name, or null if the module does not have a name.
-
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:ClasspathElementGet the URI for this classpath element.- Specified by:
getURIin classClasspathElement- Returns:
- the URI for the classpath element.
-
getAllURIs
Description copied from class:ClasspathElementGet 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:
getAllURIsin classClasspathElement- Returns:
- the URI for the classpath element.
-
getFile
File getFile()Description copied from class:ClasspathElementGet the file for this classpath element, or null if this is a module with a "jrt:" URI.- Specified by:
getFilein classClasspathElement- Returns:
- the file for the classpath element.
-
toString
Return the module reference as a String. -
equals
Equals. -
hashCode
public int hashCode()Hash code.
-