Object DependencyTreeNavigator
-
- All Implemented Interfaces:
-
org.ossreviewtoolkit.model.DependencyNavigator
public class DependencyTreeNavigator implements DependencyNavigator
A DependencyNavigator implementation based on the classic dependency tree format, which is represented by the Project.scopes property.
-
-
Field Summary
Fields Modifier and Type Field Description public final static DependencyTreeNavigatorINSTANCE
-
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. Map<String, Set<Identifier>>scopeDependencies(Project project, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)Return a map with information of the dependencies of a project grouped by scopes. 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 -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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.
-
scopeDependencies
Map<String, Set<Identifier>> scopeDependencies(Project project, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)
Return a map with information of the dependencies of a project grouped by scopes. This is equivalent to calling dependenciesForScope for all the scopes of the given project. (This base implementation does exactly this.)
-
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.
-
-
-
-