Interface IModulePathEntry
- All Known Subinterfaces:
FileSystem.Classpath
,IMultiModuleEntry
- All Known Implementing Classes:
ClasspathDirectory
,ClasspathJar
,ClasspathJep247
,ClasspathJep247Jdk12
,ClasspathJmod
,ClasspathJrt
,ClasspathJrt
,ClasspathJrtWithReleaseOption
,ClasspathLocation
,ClasspathMultiReleaseJar
,ClasspathSourceDirectory
,ClasspathSourceJar
,JrtPackageFragmentRoot
,ModulePathEntry
,ModulePathEntry.Multi
,ProjectEntry
public interface IModulePathEntry
Represents an entry on the module path of a project. Could be a single module or a collection of
modules (like a jimage or an exploded module directory structure)
-
Method Summary
Modifier and TypeMethodDescriptiondefault IModule
Get the module that this entry contributes.default IModule
getModule(char[] name)
Get the module named name from this entry.char[][]
getModulesDeclaringPackage(String qualifiedPackageName, String moduleName)
Answer the relevant modules that declare the given package.boolean
hasCompilationUnit(String qualifiedPackageName, String moduleName)
Answer whether the given package has any compilation unit (.java or .class) in the given module.default boolean
Specifies whether this entry represents an automatic module.default char[][]
Lists all packages in this modulepath entry.default boolean
servesModule(char[] name)
Indicates whether this entry knows the module named name and can answer queries regarding the module
-
Method Details
-
getModule
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
-
getModule
Get 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
-
servesModule
default boolean servesModule(char[] name)Indicates whether this entry knows the module named name and can answer queries regarding the module- Parameters:
name
- The name of the module- Returns:
- True if this entry knows the module, false otherwise
-
getModulesDeclaringPackage
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
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 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.
-
listPackages
default char[][] listPackages()Lists all packages in this modulepath entry.- Returns:
- array of flat, dot-separated package names
-
isAutomaticModule
default boolean isAutomaticModule()Specifies whether this entry represents an automatic module.- Returns:
- true if this is an automatic module, false otherwise
-