Class BindingGraph

java.lang.Object
dagger.spi.model.BindingGraph

public abstract class BindingGraph extends Object
A graph of bindings, dependency requests, and components.

A BindingGraph represents one of the following:

  • an entire component hierarchy rooted at a Component or ProductionComponent
  • a partial component hierarchy rooted at a Subcomponent or ProductionSubcomponent (only when the value of -Adagger.fullBindingGraphValidation is not NONE)
  • the bindings installed by a Module or ProducerModule, including all subcomponents generated by Module.subcomponents() ()} and ProducerModule#subcomponents() ()}
In the case of a BindingGraph representing a module, the root BindingGraph.ComponentNode will actually represent the module type. The graph will also be a full binding graph, which means it will contain all bindings in all modules, as well as nodes for their dependencies. Otherwise it will contain only bindings that are reachable from at least one entry point.

Nodes

There is a Binding for each owned binding in the graph. If a binding is owned by more than one component, there is one binding object for that binding for every owning component.

There is a component node (without a binding) for each component in the graph.

Edges

There is a dependency edge for each dependency request in the graph. Its target node is the binding 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 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 creator binding (either a method on the component or a set of @Module.subcomponents annotation values), the source node is the binding 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.

  • Constructor Details

    • BindingGraph

      public BindingGraph()
  • Method Details