-
public interface LibraryResolverService for resolving library resources to one or more local paths for compilation. Look up availableLibraryResolver.Providervia service loader to create instances. Instances are not intended to be reusable and so may maintain their own cache of previously resolved entries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLibraryResolver.ContextContext providing access to existing resolved libraries and files, the Lookup for resource resolution, and a LogBuilder for reporting information and errors.static classLibraryResolver.EntryData type giving a resource and the additional, resolved local files that were added for that resource.static interfaceLibraryResolver.ProviderProvider interface for creating instances ofLibraryResolver.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voiddispose()Optional hook for disposing of cached resources.Optional<LibraryResolver.Entry>resolve(PResource resource, LibraryResolver.Context context)Resolve the provided resource to anLibraryResolver.Entrywith local files to add for compilation.
-
-
-
Method Detail
-
resolve
Optional<LibraryResolver.Entry> resolve(PResource resource, LibraryResolver.Context context) throws Exception
Resolve the provided resource to anLibraryResolver.Entrywith local files to add for compilation. The resolved entry will be from the first resolver to return a result. The entry should only contain additional files required to resolve the requested resource on top of the already resolved resources in the provided context.The resolver may return an alternative primary resource in the entry if an earlier resolution provides the required library, eg. at a different version. The entry may also report additional resources that have been provided by the additional files, such as additional transitive dependencies or alternative identifiers.
The resolver should throw an exception if the resource is a type it should be able to resolve but for some reason cannot.
- Parameters:
resource- library resourcecontext- context, including already resolved paths- Returns:
- optional list of paths
- Throws:
Exception- if the resolver claims the resource but cannot resolve
-
dispose
default void dispose()
Optional hook for disposing of cached resources. The instance should not be used after this method has been called.
-
-