Class LocationManager
- java.lang.Object
-
- org.codehaus.plexus.languages.java.jpms.LocationManager
-
@Named @Singleton public class LocationManager extends java.lang.ObjectMaps artifacts to modules and analyzes the type of required modules- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description private ModuleInfoParserbinaryParserprivate ManifestModuleNameExtractormanifestModuleNameExtractorprivate SourceModuleInfoParsersourceParser
-
Constructor Summary
Constructors Constructor Description LocationManager()LocationManager(ModuleInfoParser binaryParser, SourceModuleInfoParser sourceParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcollectProviders(JavaModuleDescriptor moduleDescriptor, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> availableProviders)private <T> JavaModuleDescriptorgetMainModuleDescriptor(ResolvePathsRequest<T> request)ResolvePathResultparseModuleDescriptor(java.io.File descriptorPath)ResolvePathResultparseModuleDescriptor(java.lang.String descriptorPath)ResolvePathResultparseModuleDescriptor(java.nio.file.Path descriptorPath)private ResolvePathResultresolvePath(java.nio.file.Path path, ModuleNameExtractor fileModulenameExtractor)<T> ResolvePathResultresolvePath(ResolvePathRequest<T> request)Resolve a single jar<T> ResolvePathsResult<T>resolvePaths(ResolvePathsRequest<T> request)Decide for everyrequest.getPathElements()if it belongs to the modulePath or classPath, based on therequest.getMainModuleDescriptor().private voidselectModule(java.lang.String module, java.util.Map<java.lang.String,JavaModuleDescriptor> availableModules, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> availableProviders, java.util.Set<java.lang.String> namedModules, boolean includeStatic)private voidselectRequires(JavaModuleDescriptor module, java.util.Map<java.lang.String,JavaModuleDescriptor> availableModules, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> availableProviders, java.util.Set<java.lang.String> namedModules, boolean includeStatic)
-
-
-
Field Detail
-
binaryParser
private ModuleInfoParser binaryParser
-
sourceParser
private SourceModuleInfoParser sourceParser
-
manifestModuleNameExtractor
private ManifestModuleNameExtractor manifestModuleNameExtractor
-
-
Constructor Detail
-
LocationManager
public LocationManager()
-
LocationManager
LocationManager(ModuleInfoParser binaryParser, SourceModuleInfoParser sourceParser)
-
-
Method Detail
-
parseModuleDescriptor
public ResolvePathResult parseModuleDescriptor(java.nio.file.Path descriptorPath) throws java.io.IOException
- Parameters:
descriptorPath- nevernull- Returns:
- the parsed module descriptor
- Throws:
java.io.IOException- when descriptorPath could not be read
-
parseModuleDescriptor
public ResolvePathResult parseModuleDescriptor(java.io.File descriptorPath) throws java.io.IOException
- Parameters:
descriptorPath- nevernull- Returns:
- the parsed module descriptor
- Throws:
java.io.IOException- when descriptorPath could not be read
-
parseModuleDescriptor
public ResolvePathResult parseModuleDescriptor(java.lang.String descriptorPath) throws java.io.IOException
- Parameters:
descriptorPath- nevernull- Returns:
- the parsed module descriptor
- Throws:
java.io.IOException- when descriptorPath could not be read
-
resolvePath
public <T> ResolvePathResult resolvePath(ResolvePathRequest<T> request) throws java.io.IOException
Resolve a single jar- Parameters:
request- the request- Returns:
- the
ResolvePathResult, containing the name and optional module descriptor - Throws:
java.io.IOException- if any occurs
-
resolvePaths
public <T> ResolvePathsResult<T> resolvePaths(ResolvePathsRequest<T> request) throws java.io.IOException
Decide for everyrequest.getPathElements()if it belongs to the modulePath or classPath, based on therequest.getMainModuleDescriptor().- Parameters:
request- the paths to resolve- Returns:
- the result of the resolution
- Throws:
java.io.IOException- if a critical IOException occurs
-
getMainModuleDescriptor
private <T> JavaModuleDescriptor getMainModuleDescriptor(ResolvePathsRequest<T> request) throws java.io.IOException
- Throws:
java.io.IOException
-
resolvePath
private ResolvePathResult resolvePath(java.nio.file.Path path, ModuleNameExtractor fileModulenameExtractor) throws java.io.IOException
- Throws:
java.io.IOException
-
selectRequires
private void selectRequires(JavaModuleDescriptor module, java.util.Map<java.lang.String,JavaModuleDescriptor> availableModules, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> availableProviders, java.util.Set<java.lang.String> namedModules, boolean includeStatic)
-
selectModule
private void selectModule(java.lang.String module, java.util.Map<java.lang.String,JavaModuleDescriptor> availableModules, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> availableProviders, java.util.Set<java.lang.String> namedModules, boolean includeStatic)
-
collectProviders
private void collectProviders(JavaModuleDescriptor moduleDescriptor, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> availableProviders)
-
-