Collects configuration information (primarily
bindings) which will be used to create an {@link Injector}. Guice provides this object to your application's {@link Module}s so they may each contribute their own bindings.
The bindings contributed by {@code Module}s define how the {@code Injector} resolves dependencies. A {@link Key} consisting of a typeand optional annotation uniquely identifies a binding within an {@code Injector}.
You may bind from a key to:
- Another binding, which this binding's key is now "aliased to"
- Another binding, which references a {@link Provider} for this key
- A preconstructed instance
- A preconstructed instance which should be used as the {@link Provider}for this binding
In addition, a binding may have an associated scope, such as {@link Scopes#SINGLETON}, and singleton bindings may specify eager or lazy initialization.
See the users' guide appendix, "How the Injector resolves injection requests," to better understand binding resolution.
After an {@code Injector} has been created, its bindings may beexamined using methods like {@link Injector#getBinding(Key)}, but this read-only {@link Binding} type is not used when creating thebindings.