public final class Util extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Util.ModuleProvider
Interface for a classloader to declare that it comes from a module.
|
Modifier and Type | Field and Description |
---|---|
static Logger |
err
Log everything happening in the module system.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkPackageDependency(Dependency dep,
ClassLoader cl)
Check whether a package dependency is met.
|
static String |
createPackageName(String name)
Convert a class file name to a resource name suitable for Beans.instantiate.
|
static String[] |
getLocalizingSuffixesFast()
Similar to
NbBundle.getLocalizingSuffixes() but optimized. |
static SpecificationVersion |
getModuleDep(Set<Dependency> dependencies,
String cnb)
Get API module dependency, if any, for a module.
|
static Map<Module,List<Module>> |
moduleDependencies(Collection<Module> modules,
Map<String,Module> modulesByName,
Map<String,Set<Module>> _providersOf)
Enumerate (direct) interdependencies among a set of modules.
|
static Object[] |
parseCodeName(String cn)
Find the code name base and major release version from a code name.
|
static void |
transitiveClosureModuleDependencies(ModuleManager mgr,
Set<Module> modules)
Transitively fill out a set of modules with all of its module dependencies.
|
public static final Logger err
public static String[] getLocalizingSuffixesFast()
NbBundle.getLocalizingSuffixes()
but optimized.public static boolean checkPackageDependency(Dependency dep, ClassLoader cl) throws IllegalArgumentException
dep
- a module dependencycl
- a package-accessible classloaderIllegalArgumentException
public static Map<Module,List<Module>> moduleDependencies(Collection<Module> modules, Map<String,Module> modulesByName, Map<String,Set<Module>> _providersOf)
modules
- some modulesmodulesByName
- map from module cnbs to modules (may contain unrelated modules)providersOf
- map from tokens to sets of modules providing them (may mention unrelated modules)JST-PENDING needed from tests
public static String createPackageName(String name) throws IllegalArgumentException
name
- resource name of class file.class
/.ser
extension, and using dots as package separatorIllegalArgumentException
- if the name did not have a valid extension, or originally contained dots outside the extension, etc.public static Object[] parseCodeName(String cn) throws NumberFormatException
NumberFormatException
- if the release version is mangledpublic static SpecificationVersion getModuleDep(Set<Dependency> dependencies, String cnb)
dependencies
- module dependenciescnb
- code name base of API modulepublic static void transitiveClosureModuleDependencies(ModuleManager mgr, Set<Module> modules)
mgr
- the managermodules
- a mutable set of modules