public final class BindingGraph
extends java.lang.Object
There is a binding node for each owned binding in the graph. If a binding is owned by more than one component, there is one binding node for that binding for every owning component.
There is a component node (without a binding) for each component in the graph.
There is a dependency edge for each dependency request in the graph. Its target node is the binding node for the binding that satisfies the request. For entry point dependency requests, the source node is the component node for the component for which it is an entry point. For other dependency requests, the source node is the binding node for the binding that contains the request.
There is a subcomponent edge for each parent-child component relationship in the graph.
The target node is the component node for the child component. For subcomponents defined by a
subcomponent builder binding (either a method on the
component or a set of @Module.subcomponents
annotation values), the source node is the
binding node for the @Subcomponent.Builder
type. For subcomponents defined by subcomponent factory methods, the source node is the component node for
the parent.
Note that this API is experimental and will change.
Modifier and Type | Class and Description |
---|---|
static interface |
BindingGraph.BindingNode
A binding node in the binding graph.
|
static interface |
BindingGraph.ChildFactoryMethodEdge
An edge that represents a subcomponent factory method linking a parent component to a child
subcomponent.
|
static interface |
BindingGraph.ComponentNode
A component node in the graph.
|
static interface |
BindingGraph.DependencyEdge
An edge that represents a dependency on a binding.
|
static interface |
BindingGraph.Edge
An edge in the binding graph.
|
static interface |
BindingGraph.MaybeBindingNode
A node in the binding graph that is either a
BindingGraph.BindingNode or a BindingGraph.MissingBindingNode . |
static class |
BindingGraph.MissingBindingNode
A node in the binding graph that represents a missing binding for a key in a component.
|
static interface |
BindingGraph.Node
A node in the binding graph.
|
static interface |
BindingGraph.SubcomponentBuilderBindingEdge
An edge that represents the link between a parent component and a child subcomponent implied by
a subcomponent builder binding.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<BindingGraph.BindingNode> |
bindingNodes()
Returns the binding nodes.
|
com.google.common.collect.ImmutableSet<BindingGraph.BindingNode> |
bindingNodes(Key key)
Returns the binding nodes for a key.
|
java.util.Optional<BindingGraph.ComponentNode> |
componentNode(ComponentPath component)
Returns the component node for a component.
|
com.google.common.collect.ImmutableSet<BindingGraph.ComponentNode> |
componentNodes()
Returns the component nodes.
|
com.google.common.collect.ImmutableSet<BindingGraph.ComponentNode> |
componentNodes(javax.lang.model.element.TypeElement component)
Returns the component nodes for a component.
|
com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> |
dependencyEdges()
Returns the dependency edges.
|
com.google.common.collect.ImmutableSetMultimap<DependencyRequest,BindingGraph.DependencyEdge> |
dependencyEdges(BindingGraph.BindingNode bindingNode)
Returns the dependency edges for the dependencies of a binding.
|
com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> |
dependencyEdges(DependencyRequest dependencyRequest)
Returns the dependency edges for a dependency request.
|
com.google.common.collect.ImmutableSet<BindingGraph.MaybeBindingNode> |
entryPointBindingNodes()
Returns the binding nodes or missing binding nodes that directly satisfy entry points.
|
com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> |
entryPointEdges()
Returns the dependency edges for all entry points for all components and subcomponents.
|
com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> |
entryPointEdges(ComponentPath component)
Returns the dependency edges for the entry points of a given
component . |
com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> |
entryPointEdgesDependingOnBindingNode(BindingGraph.MaybeBindingNode bindingNode)
Returns the edges for entry points that transitively depend on a binding or missing binding for
a key.
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
com.google.common.collect.ImmutableSet<BindingGraph.MissingBindingNode> |
missingBindingNodes()
Returns the nodes that represent missing bindings.
|
com.google.common.graph.ImmutableNetwork<BindingGraph.Node,BindingGraph.Edge> |
network()
Returns the graph in its
Network representation. |
BindingGraph.ComponentNode |
rootComponentNode()
Returns the component node for the root component.
|
java.lang.String |
toString() |
public com.google.common.graph.ImmutableNetwork<BindingGraph.Node,BindingGraph.Edge> network()
Network
representation.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public com.google.common.collect.ImmutableSet<BindingGraph.BindingNode> bindingNodes()
public com.google.common.collect.ImmutableSet<BindingGraph.BindingNode> bindingNodes(Key key)
public com.google.common.collect.ImmutableSet<BindingGraph.MissingBindingNode> missingBindingNodes()
public com.google.common.collect.ImmutableSet<BindingGraph.ComponentNode> componentNodes()
public java.util.Optional<BindingGraph.ComponentNode> componentNode(ComponentPath component)
public com.google.common.collect.ImmutableSet<BindingGraph.ComponentNode> componentNodes(javax.lang.model.element.TypeElement component)
public BindingGraph.ComponentNode rootComponentNode()
public com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> dependencyEdges()
public com.google.common.collect.ImmutableSetMultimap<DependencyRequest,BindingGraph.DependencyEdge> dependencyEdges(BindingGraph.BindingNode bindingNode)
DependencyRequest
will map to a single BindingGraph.DependencyEdge
. When conflicting bindings exist
for a key, the multimap will have several edges for that DependencyRequest
. Graphs that
have no binding for a key will have an edge whose target
node is a BindingGraph.MissingBindingNode
.public com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> dependencyEdges(DependencyRequest dependencyRequest)
public com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> entryPointEdges(ComponentPath component)
component
. Each edge's
source node is that component's component node.public com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> entryPointEdges()
public com.google.common.collect.ImmutableSet<BindingGraph.MaybeBindingNode> entryPointBindingNodes()
public com.google.common.collect.ImmutableSet<BindingGraph.DependencyEdge> entryPointEdgesDependingOnBindingNode(BindingGraph.MaybeBindingNode bindingNode)