Top Description Fields Constructors Methods
io.github.classgraph

pack-priv Class ClasspathElementModule

extends ClasspathElement
Class Inheritance
Imports
java.io.File, .IOException, .InputStream, java.net.URI, java.nio.ByteBuffer, java.nio.file.attribute.PosixFilePermission, java.util.Collections, .HashSet, .List, .Set, java.util.concurrent.atomic.AtomicBoolean, io.github.classgraph.Scanner.ClasspathEntryWorkUnit, nonapi.io.github.classgraph.concurrency.SingletonMap, .SingletonMap.NewInstanceException, .SingletonMap.NullSingletonException, .WorkQueue, nonapi.io.github.classgraph.fastzipfilereader.LogicalZipFile, nonapi.io.github.classgraph.fileslice.reader.ClassfileReader, nonapi.io.github.classgraph.recycler.RecycleOnClose, .Recycler, nonapi.io.github.classgraph.scanspec.ScanSpec, .ScanSpec.ScanSpecPathMatch, nonapi.io.github.classgraph.utils.CollectionUtils, .LogNode, .ProxyingInputStream, .VersionFinder

A module classpath element.
Author
luke

Field Summary

Modifier and TypeField and Description
private final Set<String>
allResourcePaths

All resource paths.

private Recycler<ModuleReaderProxy, IOException>
moduleReaderProxyRecycler

The module reader proxy recycler.

pack-priv final ModuleRef
moduleRef

The module ref.

pack-priv SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException>
moduleRefToModuleReaderProxyRecyclerMap

A singleton map from a ModuleRef to a ModuleReaderProxy recycler for the module.

Inherited from io.github.classgraph.ClasspathElement:
acceptedClassfileResourcesacceptedResourceschildClasspathElementsclassLoaderclasspathElementIdxclasspathElementIdxWithinParentcontainsSpecificallyAcceptedClasspathElementResourcePathfileToLastModifiedmoduleNameFromModuleDescriptornestedClasspathRootPrefixespackageRootPrefixscannedscanResultscanSpecskipClasspathElement

Constructor Summary

AccessConstructor and Description
pack-priv
ClasspathElementModule(final ModuleRef
the module ref
moduleRef
,
final SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException>
the module ref to module reader proxy recycler map
moduleRefToModuleReaderProxyRecyclerMap
,
final Scanner.ClasspathEntryWorkUnit
the work unit
workUnit
,
final ScanSpec
the scan spec
scanSpec
)

A zip/jarfile classpath element.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true, if successful
equals
(final Object
the obj
obj
)

Overrides java.lang.Object.equals.

Equals.

pack-priv List<URI>
getAllURIs()

Implements abstract io.github.classgraph.ClasspathElement.getAllURIs.

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.

pack-priv File
getFile()

Implements abstract io.github.classgraph.ClasspathElement.getFile.

Get the file for this classpath element, or null if this is a module with a "jrt:" URI.

public String

Returns:

the module name, or null if the module does not have a name.
getModuleName
()

Implements abstract io.github.classgraph.ClasspathElement.getModuleName.

Get the module name from the module reference or the module descriptor.

private String

Returns:

the module name, or the empty string if the module does not have a name.
getModuleNameOrEmpty
()

Get the module name from the module reference or the module descriptor.

pack-priv ModuleRef

Returns:

the module ref
getModuleRef
()

Get the ModuleRef for this classpath element.

pack-priv Resource

Returns:

The Resource for the given relative path, or null if relativePath does not exist in this classpath element.
getResource
(final String
The relative path of the Resource to return.
relativePath
)

Implements abstract io.github.classgraph.ClasspathElement.getResource.

Get the Resource for a given relative path.

pack-priv URI
getURI()

Implements abstract io.github.classgraph.ClasspathElement.getURI.

Get the URI for this classpath element.

public int

Returns:

the int
hashCode
()

Overrides java.lang.Object.hashCode.

Hash code.

private Resource

Returns:

the resource
newResource
(final String
the resource path
resourcePath
)

Create a new Resource object for a resource or classfile discovered while scanning paths.

pack-priv void
open(final WorkQueue<Scanner.ClasspathEntryWorkUnit>
the work queue
workQueueIgnored
,
final LogNode
the log
log
)

Implements abstract io.github.classgraph.ClasspathElement.open.

Determine if this classpath element is valid.

pack-priv void
scanPaths(final LogNode
the log
log
)

Implements abstract io.github.classgraph.ClasspathElement.scanPaths.

Scan for package matches within module.

public String

Returns:

the string
toString
()

Overrides java.lang.Object.toString.

Return the module reference as a String.

Inherited from io.github.classgraph.ClasspathElement:
addAcceptedResourcecheckResourcePathAcceptRejectcompareTofinishScanPathsgetClassLoadergetNumClassfileMatchesloglogmaskClassfilessetScanResult

Field Detail

allResourcePathsback to summary
private final Set<String> allResourcePaths

All resource paths.

moduleReaderProxyRecyclerback to summary
private Recycler<ModuleReaderProxy, IOException> moduleReaderProxyRecycler

The module reader proxy recycler.

moduleRefback to summary
pack-priv final ModuleRef moduleRef

The module ref.

moduleRefToModuleReaderProxyRecyclerMapback to summary
pack-priv SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException> moduleRefToModuleReaderProxyRecyclerMap

A singleton map from a ModuleRef to a ModuleReaderProxy recycler for the module.

Constructor Detail

ClasspathElementModuleback to summary
pack-priv ClasspathElementModule(final ModuleRef moduleRef, final SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException> moduleRefToModuleReaderProxyRecyclerMap, final Scanner.ClasspathEntryWorkUnit workUnit, final ScanSpec scanSpec)

A zip/jarfile classpath element.

Parameters
moduleRef:ModuleRef

the module ref

moduleRefToModuleReaderProxyRecyclerMap:SingletonMap<ModuleRef, Recycler<ModuleReaderProxy, IOException>, IOException>

the module ref to module reader proxy recycler map

workUnit:Scanner.ClasspathEntryWorkUnit

the work unit

scanSpec:ScanSpec

the scan spec

Method Detail

equalsback to summary
public boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Equals.

Parameters
obj:Object

the obj

Returns:boolean

true, if successful

Annotations
@Override
getAllURIsback to summary
pack-priv List<URI> getAllURIs()

Implements abstract io.github.classgraph.ClasspathElement.getAllURIs.

Doc from io.github.classgraph.ClasspathElement.getAllURIs.

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.

Returns:List<URI>

the URI for the classpath element.

Annotations
@Override
getFileback to summary
pack-priv File getFile()

Implements abstract io.github.classgraph.ClasspathElement.getFile.

Doc from io.github.classgraph.ClasspathElement.getFile.

Get the file for this classpath element, or null if this is a module with a "jrt:" URI.

Returns:File

the file for the classpath element.

Annotations
@Override
getModuleNameback to summary
public String getModuleName()

Implements abstract io.github.classgraph.ClasspathElement.getModuleName.

Get the module name from the module reference or the module descriptor.

Returns:String

the module name, or null if the module does not have a name.

Annotations
@Override
getModuleNameOrEmptyback to summary
private String getModuleNameOrEmpty()

Get the module name from the module reference or the module descriptor.

Returns:String

the module name, or the empty string if the module does not have a name.

getModuleRefback to summary
pack-priv ModuleRef getModuleRef()

Get the ModuleRef for this classpath element.

Returns:ModuleRef

the module ref

getResourceback to summary
pack-priv Resource getResource(final String relativePath)

Implements abstract io.github.classgraph.ClasspathElement.getResource.

Get the Resource for a given relative path.

Parameters
relativePath:String

The relative path of the Resource to return.

Returns:Resource

The Resource for the given relative path, or null if relativePath does not exist in this classpath element.

Annotations
@Override
getURIback to summary
pack-priv URI getURI()

Implements abstract io.github.classgraph.ClasspathElement.getURI.

Doc from io.github.classgraph.ClasspathElement.getURI.

Get the URI for this classpath element.

Returns:URI

the URI for the classpath element.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Hash code.

Returns:int

the int

Annotations
@Override
newResourceback to summary
private Resource newResource(final String resourcePath)

Create a new Resource object for a resource or classfile discovered while scanning paths.

Parameters
resourcePath:String

the resource path

Returns:Resource

the resource

openback to summary
pack-priv void open(final WorkQueue<Scanner.ClasspathEntryWorkUnit> workQueueIgnored, final LogNode log) throws InterruptedException

Implements abstract io.github.classgraph.ClasspathElement.open.

Doc from io.github.classgraph.ClasspathElement.open.

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.

Parameters
workQueueIgnored:WorkQueue<Scanner.ClasspathEntryWorkUnit>

the work queue

log:LogNode

the log

Annotations
@Override
Exceptions
InterruptedException:
if the thread was interrupted while trying to open the classpath element.
scanPathsback to summary
pack-priv void scanPaths(final LogNode log)

Implements abstract io.github.classgraph.ClasspathElement.scanPaths.

Scan for package matches within module.

Parameters
log:LogNode

the log

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return the module reference as a String.

Returns:String

the string

Annotations
@Override