Interface DependencyNavigator
-
- All Implemented Interfaces:
public interface DependencyNavigatorAn interface allowing the navigation through the dependency information contained in an OrtResult, independent of the concrete storage representation.
The dependencies detected by the analyzer are represented in an OrtResult in an optimized form which is not accessible easily. To simplify dealing with dependencies, this interface offers functionality tailored towards the typical use cases required by the single ORT components.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDependencyNavigator.Companion
-
Method Summary
Modifier and Type Method Description abstract Set<String>scopeNames(Project project)Return a set with the names of all the scopes defined for the given project. abstract Sequence<DependencyNode>directDependencies(Project project, String scopeName)Return a sequence with DependencyNodes for the direct dependencies for the given project and scopeName. abstract 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. abstract 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. Map<String, Map<Identifier, List<Identifier>>>getShortestPaths(Project project)Return a map with the shortest paths to each dependency in all scopes of the given project. Set<Identifier>collectSubProjects(Project project)Return the set of Identifiers that refer to subprojects of the given project. Set<Identifier>projectDependencies(Project project, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)Return a set with the Identifiers of all dependencies of the given project across all scopes. IntegerdependencyTreeDepth(Project project, String scopeName)Return the depth of the dependency tree rooted at the given project associated with this scopeName. Map<Identifier, Set<Issue>>projectIssues(Project project)Return a map of all de-duplicated Issues associated by Identifier for the given project. -
-
Method Detail
-
scopeNames
abstract Set<String> scopeNames(Project project)
Return a set with the names of all the scopes defined for the given project.
-
directDependencies
abstract 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
abstract 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
abstract 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.
-
getShortestPaths
Map<String, Map<Identifier, List<Identifier>>> getShortestPaths(Project project)
Return a map with the shortest paths to each dependency in all scopes of the given project. The path to a dependency is defined by the nodes of the dependency tree that need to be passed to get to the dependency. For direct dependencies the shortest path is empty. The resulting map has scope names as keys; the values are maps with the shorted paths to all the dependencies contained in that scope.
-
collectSubProjects
Set<Identifier> collectSubProjects(Project project)
Return the set of Identifiers that refer to subprojects of the given project.
-
projectDependencies
Set<Identifier> projectDependencies(Project project, Integer maxDepth, Function1<DependencyNode, Boolean> matcher)
Return a set with the Identifiers of all dependencies of the given project across all scopes. As usual, it is possible to restrict the dependencies to be fetched with maxDepth and matcher.
-
dependencyTreeDepth
Integer dependencyTreeDepth(Project project, String scopeName)
Return the depth of the dependency tree rooted at the given project associated with this scopeName. If the scope cannot be resolved, return -1.
-
projectIssues
Map<Identifier, Set<Issue>> projectIssues(Project project)
Return a map of all de-duplicated Issues associated by Identifier for the given project.
-
-
-
-