Class ClasspathJsr199
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation
org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathJsr199
- All Implemented Interfaces:
FileSystem.Classpath,IModulePathEntry,SuffixConstants
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation
accessRuleSet, BINARY, destinationPath, SOURCEFields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.util.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_JAVA -
Constructor Summary
ConstructorsConstructorDescriptionClasspathJsr199(JavaFileManager file, JavaFileManager.Location location) ClasspathJsr199(JavaFileManager fileManager, JavaFileManager.Location location, Set<JavaFileObject> initialJavaFileObjects, Supplier<Parser> parserSupplier) Constructor for mapping SOURCE_PATH to ClasspathLocation.ClasspathJsr199(ClasspathJep247 older, JavaFileManager file, JavaFileManager.Location location) ClasspathJsr199(FileSystem.Classpath jrt, JavaFileManager file, JavaFileManager.Location location) -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptModule(IModule mod) Accepts to represent a module location with the given module description.static IModuleextractModuleFromFileObject(JavaFileObject javaFileObject, Supplier<Parser> parserSupplier, FileSystem.Classpath pathEntry, String encoding) 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 aQualifiedBinaryFileName, boolean asBinaryOnly) char[][][]findTypeNames(String aQualifiedPackageName, String moduleName) intgetMode()Get the module that this entry contributes.getModule(char[] name) Get the module named name from this entry.getModuleNames(Collection<String> limitModules) char[][]getModulesDeclaringPackage(String aQualifiedPackageName, 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 entrychar[][]Lists all packages in this modulepath entry.char[]Return a normalized path for file based classpath entries.static CompilationUnitreadCompilationUnit(JavaFileObject jfo, String encoding) static ClassFileReaderreadJavaClass(JavaFileObject jfo, String name) voidreset()This method resets the environment.toString()Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation
allModules, equals, fetchAccessRestriction, getDestinationPath, getModuleNames, hashCode, isAutomaticModule, isPackage, selectModules, singletonModuleNameIfMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem.Classpath
forbidsExportFrom, hasCUDeclaringPackageMethods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.IModulePathEntry
servesModule
-
Constructor Details
-
ClasspathJsr199
-
ClasspathJsr199
public ClasspathJsr199(FileSystem.Classpath jrt, JavaFileManager file, JavaFileManager.Location location) -
ClasspathJsr199
public ClasspathJsr199(ClasspathJep247 older, JavaFileManager file, JavaFileManager.Location location) -
ClasspathJsr199
public ClasspathJsr199(JavaFileManager fileManager, JavaFileManager.Location location, Set<JavaFileObject> initialJavaFileObjects, Supplier<Parser> parserSupplier) Constructor for mapping SOURCE_PATH to ClasspathLocation.
-
-
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.- 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 aQualifiedBinaryFileName, boolean asBinaryOnly) -
findTypeNames
-
initialize
-
acceptModule
Description copied from interface:FileSystem.ClasspathAccepts to represent a module location with the given module description.- Specified by:
acceptModulein interfaceFileSystem.Classpath- Overrides:
acceptModulein classClasspathLocation
-
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. -
listPackages
public char[][] listPackages()Description copied from interface:IModulePathEntryLists all packages in this modulepath entry.- Returns:
- array of flat, dot-separated package names
-
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.- 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.
-
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.- 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
-
hasAnnotationFileFor
Description copied from interface:FileSystem.ClasspathCan the current location provide an external annotation file for the given type?- Parameters:
qualifiedTypeName- type name in qualified /-separated notation.
-
getModuleNames
- Specified by:
getModuleNamesin interfaceFileSystem.Classpath- Overrides:
getModuleNamesin classClasspathLocation
-
hasModule
public boolean hasModule() -
getModule
Description copied from interface:IModulePathEntryGet the module named name from this entry. May be null- Parameters:
name- - The name of the module to look up- Returns:
- The module named name or null
-
getModule
Description copied from interface:IModulePathEntryGet 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
-
findClass
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName) -
readJavaClass
public static ClassFileReader readJavaClass(JavaFileObject jfo, String name) throws ClassFormatException, IOException - Throws:
ClassFormatExceptionIOException
-
readCompilationUnit
public static CompilationUnit readCompilationUnit(JavaFileObject jfo, String encoding) throws IOException - Throws:
IOException
-
extractModuleFromFileObject
public static IModule extractModuleFromFileObject(JavaFileObject javaFileObject, Supplier<Parser> parserSupplier, FileSystem.Classpath pathEntry, String encoding)
-