Class ClasspathJrt
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation
org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathJrt
- All Implemented Interfaces:
FileSystem.Classpath, IModulePathEntry, IMultiModuleEntry, SuffixConstants
- Direct Known Subclasses:
ClasspathJep247
-
Nested Class Summary
Nested classes/interfaces inherited from interface FileSystem.Classpath
FileSystem.Classpath.PathKind -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ZipFileprotected final booleanfinal Fileprotected final JrtFileSystemFields inherited from class ClasspathLocation
accessRuleSet, BINARY, destinationPath, SOURCEModifier and TypeFieldDescriptionfinal AccessRuleSetstatic final intfinal Stringstatic final intFields inherited from interface SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVAModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final char[]static final char[]static final char[]static final char[]static final char[]static final char[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionClasspathJrt(File file, boolean closeZipFileAtEnd, AccessRuleSet accessRuleSet, String destinationPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTypeName(ArrayList answers, String fileName, int last, char[] packageName) allModules(Iterable<T> allSystemModules, Function<T, String> getModuleName, Function<T, IModule> getModule) static voidclearCache(String path, String releaseVersion) fetchLinkedJars(FileSystem.ClasspathSectionProblemReporter problemReporter) Return a list of the jar file names defined in the Class-Path section of the jar file manifest if any, null else.findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName) findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly) char[][][]findTypeNames(String qualifiedPackageName, String moduleName) intgetMode()getModule(char[] moduleName) Get the module named name from this entry.getModuleNames(Collection<String> limitModule, Function<String, IModule> getModule) char[][]getModulesDeclaringPackage(String qualifiedPackageName, String moduleName) Answer the relevant modules that declare the given package.getPath()Return the path for file based classpath entries.booleanhasAnnotationFileFor(String qualifiedTypeName) Can the current location provide an external annotation file for the given type?booleanhasCompilationUnit(String qualifiedPackageName, String moduleName) Answer whether the given package has any compilation unit (.java or .class) in the given module.booleanvoidInitialize the entryvoidprotected IBinaryTypemaybeDecorateForExternalAnnotations(String qualifiedBinaryFileName, IBinaryType reader) char[]Return a normalized path for file based classpath entries.voidreset()This method resets the environment.booleanservesModule(char[] moduleName) Indicates whether this entry knows the module named name and can answer queries regarding the moduletoString()Methods inherited from class ClasspathLocation
acceptModule, equals, fetchAccessRestriction, getDestinationPath, getModuleNames, getPathKind, hashCode, isAutomaticModule, isPackage, selectModules, setPathKind, singletonModuleNameIfModifier and TypeMethodDescriptionvoidacceptModule(IModule mod) Accepts to represent a module location with the given module description.booleanprotected AccessRestrictionfetchAccessRestriction(String qualifiedBinaryFileName) Return the first access rule which is violated when accessing a given type, or null if no 'non accessible' access rule applies.getModuleNames(Collection<String> limitModules) inthashCode()booleanSpecifies whether this entry represents an automatic module.booleanprotected Collection<String> selectModules(Set<String> modules, Collection<String> limitModules, Function<String, IModule> getModule) voidprotected char[][]singletonModuleNameIf(boolean condition) Methods inherited from interface FileSystem.Classpath
forbidsExportFrom, hasCUDeclaringPackageModifier and TypeMethodDescriptiondefault booleanforbidsExportFrom(String modName) default booleanhasCUDeclaringPackage(String qualifiedPackageName, Function<CompilationUnit, String> pkgNameExtractor) Methods inherited from interface IModulePathEntry
getModule, listPackagesModifier and TypeMethodDescriptiondefault IModuleGet the module that this entry contributes.default char[][]Lists all packages in this modulepath entry.Methods inherited from interface IMultiModuleEntry
getModuleNamesModifier and TypeMethodDescriptiongetModuleNames(Collection<String> limitModules) Get the names of all modules served by this entry.
-
Field Details
-
file
-
jrtFileSystem
-
annotationZipFile
-
closeZipFileAtEnd
protected final boolean closeZipFileAtEnd -
ModulesCache
-
moduleNamesCache
-
annotationPaths
-
-
Constructor Details
-
ClasspathJrt
public ClasspathJrt(File file, boolean closeZipFileAtEnd, AccessRuleSet accessRuleSet, String destinationPath)
-
-
Method Details
-
fetchLinkedJars
Description copied from interface:FileSystem.ClasspathReturn 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.- Specified by:
fetchLinkedJarsin interfaceFileSystem.Classpath- 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
-
getModulesDeclaringPackage
Description copied from interface:IModulePathEntryAnswer 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.- Specified by:
getModulesDeclaringPackagein interfaceIModulePathEntry
-
hasCompilationUnit
Description copied from interface:IModulePathEntryAnswer 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.- Specified by:
hasCompilationUnitin interfaceIModulePathEntry- Parameters:
qualifiedPackageName- '/'-separated package namemoduleName- 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.
-
findClass
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName) - Specified by:
findClassin interfaceFileSystem.Classpath
-
findClass
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly) - Specified by:
findClassin interfaceFileSystem.Classpath
-
maybeDecorateForExternalAnnotations
protected IBinaryType maybeDecorateForExternalAnnotations(String qualifiedBinaryFileName, IBinaryType reader) -
hasAnnotationFileFor
Description copied from interface:FileSystem.ClasspathCan the current location provide an external annotation file for the given type?- Specified by:
hasAnnotationFileForin interfaceFileSystem.Classpath- Parameters:
qualifiedTypeName- type name in qualified /-separated notation.
-
findTypeNames
- Specified by:
findTypeNamesin interfaceFileSystem.Classpath
-
addTypeName
-
initialize
Description copied from interface:FileSystem.ClasspathInitialize the entry- Specified by:
initializein interfaceFileSystem.Classpath- Throws:
IOException
-
loadModules
public void loadModules() -
getModuleNames
public Collection<String> getModuleNames(Collection<String> limitModule, Function<String, IModule> getModule) - Specified by:
getModuleNamesin interfaceFileSystem.Classpath- Overrides:
getModuleNamesin classClasspathLocation
-
allModules
protected <T> List<String> allModules(Iterable<T> allSystemModules, Function<T, String> getModuleName, Function<T, IModule> getModule) - Overrides:
allModulesin classClasspathLocation
-
reset
public void reset()Description copied from interface:FileSystem.ClasspathThis method resets the environment. The resulting state is equivalent to a new name environment without creating a new object.- Specified by:
resetin interfaceFileSystem.Classpath- Overrides:
resetin classClasspathLocation
-
toString
-
normalizedPath
public char[] normalizedPath()Description copied from interface:FileSystem.ClasspathReturn 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.- Specified by:
normalizedPathin interfaceFileSystem.Classpath- Returns:
- a normalized path for file based classpath entries
-
getPath
Description copied from interface:FileSystem.ClasspathReturn 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:
getPathin interfaceFileSystem.Classpath- Overrides:
getPathin classClasspathLocation- Returns:
- the path for file based classpath entries
-
getMode
public int getMode()- Overrides:
getModein classClasspathLocation
-
hasModule
public boolean hasModule()- Specified by:
hasModulein interfaceFileSystem.Classpath
-
getModule
Description copied from interface:IModulePathEntryGet the module named name from this entry. May be null- Specified by:
getModulein interfaceIModulePathEntry- Specified by:
getModulein interfaceIMultiModuleEntry- Parameters:
moduleName- - The name of the module to look up- Returns:
- The module named name or null
-
servesModule
public boolean servesModule(char[] moduleName) Description copied from interface:IModulePathEntryIndicates whether this entry knows the module named name and can answer queries regarding the module- Specified by:
servesModulein interfaceIModulePathEntry- Parameters:
moduleName- The name of the module- Returns:
- True if this entry knows the module, false otherwise
-
clearCache
-