Package dagger
package dagger
This package contains the public API for the Dagger 2 dependency
injection framework. By building upon JSR 330,
Dagger 2 provides an annotation-driven API for dependency injection whose implementation is
entirely generated at compile time by annotation processors.
The entry point into the API is the Component
, which annotates abstract types for
Dagger 2 to implement. The dependency graph is configured using annotations such as Module
, Provides
and Inject
.
dagger.internal.codegen.ComponentProcessor
is the processor responsible for generating
the implementation. Dagger uses the annotation procesor service loader to automatically configure the processor, so explict build configuration
shouldn't be necessary.
-
ClassDescriptionAnnotates abstract methods of a
Module
that delegate bindings.Marks a method on a component builder or a parameter on a component factory as binding an instance to some key within the component.Annotates methods that declare bindings forOptional
containers of values from bindings that may or may not be present in the component.Annotates an interface or abstract class for which a fully-formed, dependency-injected implementation is to be generated from a set of Component.modules().A builder for a component.A factory for a component.Lazy<T>A handle to a lazily-computed value.Identifies annotation types that are used to associate keys with values returned by provider methods in order to compose a map.Injects dependencies into the fields and methods on instances of typeT
.Annotates a class that contributes to the object graph.Annotates methods of a module to create a provider method binding.A scope that indicates that the object returned by a binding may be (but might not be) reused.A subcomponent that inherits the bindings from a parentComponent
orSubcomponent
.A builder for a subcomponent.A factory for a subcomponent.