public interface Module
Injector
configuration. A module is usually used to bind abstractions
(interfaces, abstract classes) to implementations (concrete
classes). To just add a scope to a class, you can use scope
annotations like Singleton.
You can also use annotations to bind abstractions to implementations
like Targetted and ProvidedBy.
Read about the embedded dsl to configure injector in Binder.
You can also create provider methods (methods used as providers) and
annotate it with Provides. Annotate the method with
Inject if the object creation has dependencies.
There's an extension for users to create bindings in a pretty way
using AbstractModule.
Read the EDSL specification| Modifier and Type | Method and Description |
|---|---|
void |
configure(Binder binder)
Configures all bindings on the specified
binder. |
void configure(Binder binder)
binder. This method
is called before checking for methods annotated with @Provides
to create method-based providers.
Don't invoke this method to configure binders. Instead use Binder.install(team.unnamed.inject.Module...)
to check all the methods annotated with @Provides
binder - The configuring binder, attached to an specific injector