Class AbstractDependencyResolver
- java.lang.Object
-
- org.apache.jackrabbit.vault.validation.context.AbstractDependencyResolver
-
- All Implemented Interfaces:
DependencyResolver
public abstract class AbstractDependencyResolver extends Object implements DependencyResolver
Abstract resolver supporting Maven repository dependency location URIs (starting withmaven:
). All package dependencies are mapped to Maven coordinates by this class and then resolved viaresolvePackageInfo(MavenCoordinates)
. It comes with a cache so that the same package dependency is not resolved more than once. This class is not thread-safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractDependencyResolver.MavenCoordinates
-
Field Summary
Fields Modifier and Type Field Description static String
MAVEN_REPOSITORY_SCHEME
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDependencyResolver(@NotNull Collection<PackageInfo> packageInfoCache)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description @NotNull Collection<PackageInfo>
resolvePackageInfo(@NotNull Dependency[] dependencies, @NotNull Map<PackageId,URI> dependencyLocations)
Resolves multiple package dependencies taking into account a map from package id to URI (given via package propertiesdependencies-locations
).abstract @Nullable PackageInfo
resolvePackageInfo(AbstractDependencyResolver.MavenCoordinates mavenCoordinates)
-
-
-
Field Detail
-
MAVEN_REPOSITORY_SCHEME
public static final String MAVEN_REPOSITORY_SCHEME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractDependencyResolver
protected AbstractDependencyResolver(@NotNull @NotNull Collection<PackageInfo> packageInfoCache)
-
-
Method Detail
-
resolvePackageInfo
@NotNull public @NotNull Collection<PackageInfo> resolvePackageInfo(@NotNull @NotNull Dependency[] dependencies, @NotNull @NotNull Map<PackageId,URI> dependencyLocations) throws IOException
Description copied from interface:DependencyResolver
Resolves multiple package dependencies taking into account a map from package id to URI (given via package propertiesdependencies-locations
).- Specified by:
resolvePackageInfo
in interfaceDependencyResolver
- Parameters:
dependencies
- the dependencies to resolvedependencyLocations
- a map of package ids to URIs- Returns:
- the list of
PackageInfo
for all resolved dependencies (as this is only a best effort implementation the list being returned might be smaller than the array size ofdependencies
). - Throws:
IOException
- in case some error happened during resolving
-
resolvePackageInfo
@Nullable public abstract @Nullable PackageInfo resolvePackageInfo(AbstractDependencyResolver.MavenCoordinates mavenCoordinates) throws IOException
- Throws:
IOException
-
-