public class PathFinder extends Object
This is used in EagerCycleFinder and UnresolvedBindingValidator for explaining
why a given error/cycle was reachable from the Ginjector.
| Constructor and Description |
|---|
PathFinder() |
| Modifier and Type | Method and Description |
|---|---|
PathFinder |
addDestinations(Key<?>... destinations)
Add destinations to be used for the next search.
|
PathFinder |
addRoots(Key<?>... roots) |
List<Dependency> |
findShortestPath()
Find the shortest path from an unresolved edge in the roots to a key in the destinations.
|
PathFinder |
onGraph(DependencyGraph graph) |
PathFinder |
withOnlyRequiredEdges(boolean onlyRequiredEdges) |
public PathFinder onGraph(DependencyGraph graph)
public PathFinder addRoots(Key<?>... roots)
public PathFinder addDestinations(Key<?>... destinations)
findShortestPath().public PathFinder withOnlyRequiredEdges(boolean onlyRequiredEdges)
onlyRequiredEdges - if true, only required edges will be considered when searching for the
pathpublic List<Dependency> findShortestPath()
Implemented as a Breadth-first search from the destination set back to the origin.
Copyright © 2008–2018. All rights reserved.