Class DependencyGraphNavigator
-
- All Implemented Interfaces:
-
org.ossreviewtoolkit.model.DependencyNavigator
public final class DependencyGraphNavigator implements DependencyNavigator
A DependencyNavigator implementation based on the dependency graph format. It obtains the information about a project's dependencies from the shared DependencyGraph stored in the OrtResult.
-
-
Constructor Summary
Constructors Constructor Description DependencyGraphNavigator(OrtResult ortResult)DependencyGraphNavigator(Map<String, DependencyGraph> graphs)
-
Method Summary
Modifier and Type Method Description Set<String>scopeNames(Project project)Return a set with the names of all the scopes defined for the given project. Sequence<DependencyNode>directDependencies(Project project, String scopeName)Return a sequence with DependencyNodes for the direct dependencies for the given project and scopeName. Set<Identifier>dependenciesForScope(Project project, String scopeName, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)Return a set with information of the dependencies of a specific scope of a project. Set<Identifier>packageDependencies(Project project, Identifier packageId, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)Return a set with the Identifiers of packages that are dependencies of the package with the given packageId in the given project. -
Methods inherited from class org.ossreviewtoolkit.model.DependencyNavigator
collectSubProjects, dependencyTreeDepth, getShortestPaths, projectDependencies, projectIssues, scopeDependencies -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
DependencyGraphNavigator
DependencyGraphNavigator(OrtResult ortResult)
-
DependencyGraphNavigator
DependencyGraphNavigator(Map<String, DependencyGraph> graphs)
-
-
Method Detail
-
scopeNames
Set<String> scopeNames(Project project)
Return a set with the names of all the scopes defined for the given project.
-
directDependencies
Sequence<DependencyNode> directDependencies(Project project, String scopeName)
Return a sequence with DependencyNodes for the direct dependencies for the given project and scopeName. From this sequence, the whole dependency tree of that scope can be traversed.
-
dependenciesForScope
Set<Identifier> dependenciesForScope(Project project, String scopeName, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)
Return a set with information of the dependencies of a specific scope of a project. With maxDepth the depth of the dependency tree to be traversed can be restricted; negative values mean that there is no restriction. Use the specified matcher to filter for specific dependencies.
-
packageDependencies
Set<Identifier> packageDependencies(Project project, Identifier packageId, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)
Return a set with the Identifiers of packages that are dependencies of the package with the given packageId in the given project. Starting from project, the dependency graph is searched for the package in question; then its dependencies are collected. It is possible to restrict the dependencies to be fetched with maxDepth and matcher.
-
-
-
-