Interface DependencyHandler
-
- All Implemented Interfaces:
public interface DependencyHandler<D extends Object>An interface used by DependencyGraphBuilder to handle the specific representations of concrete PackageManager implementations in a generic way.
A package manager may use its own, internal representation of a type D of a dependency. When constructing the org.ossreviewtoolkit.model.DependencyGraph by passing the dependencies of the single scopes, the builder must be able to extract certain information from the dependency objects. This is done via an implementation of this interface.
-
-
Method Summary
Modifier and Type Method Description abstract IdentifieridentifierFor(D dependency)Construct a unique identifier for the given dependency. abstract Collection<D>dependenciesFor(D dependency)Return a collection with the dependencies of the given dependency. abstract PackageLinkagelinkageFor(D dependency)Return the PackageLinkage for the given dependency. abstract PackagecreatePackage(D dependency, List<Issue> issues)Create a Package to represent the given dependency. Collection<Issue>issuesForDependency(D dependency)Return a collection with known issues for the given dependency. -
-
Method Detail
-
identifierFor
abstract Identifier identifierFor(D dependency)
Construct a unique identifier for the given dependency.
-
dependenciesFor
abstract Collection<D> dependenciesFor(D dependency)
Return a collection with the dependencies of the given dependency. DependencyGraphBuilder invokes this function to construct the whole dependency tree spawned by this dependency.
-
linkageFor
abstract PackageLinkage linkageFor(D dependency)
Return the PackageLinkage for the given dependency.
-
createPackage
abstract Package createPackage(D dependency, List<Issue> issues)
Create a Package to represent the given dependency. This is used to populate the packages in the analyzer result. The creation of a package may fail, e.g. if the dependency cannot be resolved. In this case, a concrete implementation is expected to return a dummy Package with correct coordinates and add a corresponding issue to the provided issues list. If the dependency does not map to a package, an implementation should return null.
-
issuesForDependency
Collection<Issue> issuesForDependency(D dependency)
Return a collection with known issues for the given dependency. Some package manager implementations may already encounter problems when obtaining dependency representations. These can be reported here. This base implementation returns an empty collection.
-
-
-
-