java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation
org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathJar
All Implemented Interfaces:
FileSystem.Classpath, IModulePathEntry, SuffixConstants
Direct Known Subclasses:
ClasspathJmod, ClasspathMultiReleaseJar, ClasspathSourceJar

public class ClasspathJar extends ClasspathLocation
  • Field Details

    • file

      protected File file
    • zipFile

      protected ZipFile zipFile
    • annotationZipFile

      protected ZipFile annotationZipFile
    • closeZipFileAtEnd

      protected boolean closeZipFileAtEnd
    • packageCache

      protected Set<String> packageCache
    • annotationPaths

      protected List<String> annotationPaths
  • Constructor Details

    • ClasspathJar

      public ClasspathJar(File file, boolean closeZipFileAtEnd, AccessRuleSet accessRuleSet, String destinationPath)
  • Method Details

    • fetchLinkedJars

      public List<FileSystem.Classpath> fetchLinkedJars(FileSystem.ClasspathSectionProblemReporter problemReporter)
      Description copied from interface: FileSystem.Classpath
      Return a list of the jar file names defined in the Class-Path section of the jar file manifest if any, null else. Only ClasspathJar (and extending classes) instances may return a non-null result.
      Parameters:
      problemReporter - problem reporter with which potential misconfiguration issues are raised
      Returns:
      a list of the jar file names defined in the Class-Path section of the jar file manifest if any
    • findClass

      public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName)
    • findClass

      public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly)
    • hasAnnotationFileFor

      public boolean hasAnnotationFileFor(String qualifiedTypeName)
      Description copied from interface: FileSystem.Classpath
      Can the current location provide an external annotation file for the given type?
      Parameters:
      qualifiedTypeName - type name in qualified /-separated notation.
    • findTypeNames

      public char[][][] findTypeNames(String qualifiedPackageName, String moduleName)
    • initialize

      public void initialize() throws IOException
      Description copied from interface: FileSystem.Classpath
      Initialize the entry
      Throws:
      IOException
    • addToPackageCache

      protected void addToPackageCache(String fileName, boolean endsWithSep)
    • getModulesDeclaringPackage

      public char[][] getModulesDeclaringPackage(String qualifiedPackageName, String moduleName)
      Description copied from interface: IModulePathEntry
      Answer the relevant modules that declare the given package. If moduleName is ModuleBinding.ANY then all packages are relevant, if moduleName is ModuleBinding.UNNAMED, then only packages in the unnamed module are relevant, otherwise consider only packages in the module identified by moduleName.
    • hasCompilationUnit

      public boolean hasCompilationUnit(String qualifiedPackageName, String moduleName)
      Description copied from interface: IModulePathEntry
      Answer whether the given package has any compilation unit (.java or .class) in the given module. For entries representing a single module, the module name should be checked before invoking this method.
      Parameters:
      qualifiedPackageName - '/'-separated package name
      moduleName - if non-null only CUs attached to the given module should be considered
      Returns:
      true iff a .java or .class file could be found in the given module / package.
    • listPackages

      public char[][] listPackages()
      Description copied from interface: IModulePathEntry
      Lists all packages in this modulepath entry.
      Returns:
      array of flat, dot-separated package names
    • reset

      public void reset()
      Description copied from interface: FileSystem.Classpath
      This method resets the environment. The resulting state is equivalent to a new name environment without creating a new object.
      Specified by:
      reset in interface FileSystem.Classpath
      Overrides:
      reset in class ClasspathLocation
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • normalizedPath

      public char[] normalizedPath()
      Description copied from interface: FileSystem.Classpath
      Return a normalized path for file based classpath entries. This is an absolute path in which file separators are transformed to the platform-agnostic '/', ending with a '/' for directories. This is an absolute path in which file separators are transformed to the platform-agnostic '/', deprived from the '.jar' (resp. '.zip') extension for jar (resp. zip) files.
      Returns:
      a normalized path for file based classpath entries
    • getPath

      public String getPath()
      Description copied from interface: FileSystem.Classpath
      Return the path for file based classpath entries. This is an absolute path ending with a file separator for directories, an absolute path including the '.jar' (resp. '.zip') extension for jar (resp. zip) files.
      Specified by:
      getPath in interface FileSystem.Classpath
      Overrides:
      getPath in class ClasspathLocation
      Returns:
      the path for file based classpath entries
    • getMode

      public int getMode()
      Overrides:
      getMode in class ClasspathLocation
    • getModule

      public IModule getModule()
      Description copied from interface: IModulePathEntry
      Get the module that this entry contributes. May be null, for instance when this entry does not represent a single module
      Returns:
      The module that this entry contributes or null
    • ensureOpen

      protected void ensureOpen() throws IOException
      Throws:
      IOException
    • close

      public void close()