Package Summary
Interfaces which make up
Binder's expression language.
Guice (sounds like like "juice")
Used for matching things.
Support for binding to string-based names.
Guice service provider interface
Helper methods for working with Guice.
Interface Summary
Collects configuration information (primarily
bindings) which will be used to create an
Injector.
A mapping from a key (type and optional annotation) to the strategy for getting instances of the type.
Builds the graphs of objects that make up your application.
Injects dependencies into the fields and methods on instances of type
T.
A module contributes configuration information, typically interface bindings, which will be used to create an
Injector.
Returns a binder whose configuration information is hidden from its environment by default.
An object capable of providing instances of type
T.
A scope is a level of visibility that instances provided by Guice may have.
Class Summary
A support class for
Modules which reduces repetition and results in a more readable configuration.
The entry point to the Guice framework.
Binding key consisting of an injection type and an optional annotation.
A module whose configuration information is hidden from its environment by default.
Built-in scope implementations.
Represents a generic type
T.
Enum Summary
The stage we're running in.
Exception Summary
Thrown when a programming error such as a misplaced annotation, illegal binding, or unsupported scope is found.
Thrown when errors occur while creating a
Injector.
Thrown from
Provider.get() when an attempt is made to access a scoped object while the scope in question is not currently active.
Indicates that there was a runtime failure while providing an instance.
Annotation Types Summary
Annotation Type
Description
Annotates annotations which are used for binding.
Acccompanies a @
Provides method annotation in a private module to indicate that the provided binding is exposed.
A pointer to the default implementation of a type.
Annotates members of your implementation class (constructors, methods and fields) into which the
Injector should inject values.
A pointer to the default provider type for a type.
Annotates methods of a
Module to create a provider method binding.
Annotates annotations which are used for scoping.
Apply this to implementation classes when you want only one instance (per
Injector) to be reused for all injections for that binding.
Package com.google.inject Description
Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework. Please refer to the Guice
User's Guide for a gentle introduction.
The principal public APIs in this package are:
-
Inject
-
The annotation you will use in your implementation classes to tell Guice where and how it should send in ("inject") the objects you depend on (your "dependencies").
-
Module
-
The interface you will implement in order to specify "bindings" -- instructions for how Guice should handle injection -- for a particular set of interfaces.
-
Binder
-
The object that Guice passes into your
Module to collect these bindings.
-
Provider
-
The interface you will implement when you need to customize exactly how Guice creates instances for a particular binding.