public final class ModuleImportHelper
extends Object
Shared utilities for expanding JPMS module imports into package-level
star imports. Used by both the parser (AstBuilder) and the
ImportCustomizer.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static void |
collectModuleExports(ModuleReference moduleRef, ModuleFinder finder, List<String> packageNames, Set<String> visited)Collects the exported package names from the given module and, recursively, from any modules it requires transitive.
|
|
public static ModuleFinder |
moduleFinder(SourceUnit source)Builds a ModuleFinder that combines the system module finder with one scanning the compilation classpath for modular JARs. |
|
public static List<String> |
resolveModulePackages(String moduleName, ModuleFinder finder)Resolves a module by name and collects its exported packages (including transitive dependencies). |
Collects the exported package names from the given module and,
recursively, from any modules it requires transitive.
This implements the transitive readability semantics specified
by JEP 476.
moduleRef - the module to inspectfinder - the finder used to resolve transitive dependenciespackageNames - accumulator for discovered package namesvisited - set of already-visited module names (to avoid cycles)Builds a ModuleFinder that combines the system module finder with one scanning the compilation classpath for modular JARs.
source - the source unit providing classpath and classloaderResolves a module by name and collects its exported packages (including transitive dependencies).
moduleName - the JPMS module namefinder - the module finder to use