Class ClasspathElementModule

    • Field Detail

      • moduleRef

        final ModuleRef moduleRef
        The module ref.
      • moduleReaderProxyRecycler

        private Recycler<ModuleReaderProxy,​java.io.IOException> moduleReaderProxyRecycler
        The module reader proxy recycler.
      • allResourcePaths

        private final java.util.Set<java.lang.String> allResourcePaths
        All resource paths.
    • Constructor Detail

      • ClasspathElementModule

        ClasspathElementModule​(ModuleRef moduleRef,
                               SingletonMap<ModuleRef,​Recycler<ModuleReaderProxy,​java.io.IOException>,​java.io.IOException> moduleRefToModuleReaderProxyRecyclerMap,
                               Scanner.ClasspathEntryWorkUnit workUnit,
                               ScanSpec scanSpec)
        A zip/jarfile classpath element.
        Parameters:
        moduleRef - the module ref
        workUnit - the work unit
        moduleRefToModuleReaderProxyRecyclerMap - the module ref to module reader proxy recycler map
        scanSpec - the scan spec
    • Method Detail

      • open

        void open​(WorkQueue<Scanner.ClasspathEntryWorkUnit> workQueueIgnored,
                  LogNode log)
           throws java.lang.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:
        java.lang.InterruptedException - if the thread was interrupted while trying to open the classpath element.
      • newResource

        private Resource newResource​(java.lang.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​(java.lang.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 java.lang.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 java.lang.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

        java.net.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

        java.util.List<java.net.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

        java.io.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 java.lang.String toString()
        Return the module reference as a String.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string
      • equals

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

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