java.lang.Object
org.tentackle.common.ModuleSorter
A dependency sorter for jigsaw modules.
- Author:
- harald
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetModuleInfo(String name) Gets the module info for a module name.getModuleInfo(URL url) Gets the module info for a given URL.Gets the modules infos ordered by dependency.
Modules at the top of the dependency hierarchy come last, modules without further dependencies come first.sort(Enumeration<URL> urls, String serviceName) Sorts an enumeration of urls according to the module hierarchy.
The highest module ordinal comes first.toString()
-
Field Details
-
INSTANCE
The singleton.
-
-
Constructor Details
-
ModuleSorter
public ModuleSorter()Creates a module sorter and loads the module hierarchy.Finds all named modules providing a
ModuleHookvia module-info and sorts them according to their dependencies.
-
-
Method Details
-
toString
-
getModuleInfos
Gets the modules infos ordered by dependency.
Modules at the top of the dependency hierarchy come last, modules without further dependencies come first.- Returns:
- the module infos
-
getModuleInfo
Gets the module info for a module name.- Parameters:
name- the module name- Returns:
- the module info, null if no such (application) module or module has no
ModuleHook.
-
getModuleInfo
Gets the module info for a given URL.- Parameters:
url- the resource url- Returns:
- the module info, null if application not modularized, not from a module or
module does not provide a
ModuleHook.
-
sort
Sorts an enumeration of urls according to the module hierarchy.
The highest module ordinal comes first.- Parameters:
urls- the urls, usually from ClassLoader.getResourcesserviceName- the service name- Returns:
- the sorted urls
-