| Package | Description |
|---|---|
| com.google.inject |
Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.
|
| com.google.inject.binder |
Interfaces which make up
Binder's expression language.
|
| com.google.inject.internal |
Guice (sounds like like "juice")
|
| com.google.inject.spi |
Guice service provider interface
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Key |
Key.get(Class
Gets a key for an injection type.
|
static <T> Key |
Key.get(Class
Gets a key for an injection type and an annotation.
|
static <T> Key |
Key.get(Class
Gets a key for an injection type and an annotation type.
|
static Key |
Key.get(Type
Gets a key for an injection type.
|
static Key |
Key.get(Type
Gets a key for an injection type and an annotation.
|
static Key |
Key.get(Type
Gets a key for an injection type and an annotation type.
|
static <T> Key |
Key.get(TypeLiteral
Gets a key for an injection type.
|
static <T> Key |
Key.get(TypeLiteral
Gets a key for an injection type and an annotation.
|
static <T> Key |
Key.get(TypeLiteral
Gets a key for an injection type and an annotation type.
|
Key |
Binding.getKey()
Returns the key for this binding.
|
<T> Key |
Key.ofType(Class
Returns a new key of the specified type with the same annotation as this key.
|
Key |
Key.ofType(Type
Returns a new key of the specified type with the same annotation as this key.
|
<T> Key |
Key.ofType(TypeLiteral
Returns a new key of the specified type with the same annotation as this key.
|
Key |
Key.withoutAttributes()
Returns this key without annotation attributes, i.e.
|
| Modifier and Type | Method and Description |
|---|---|
Map |
Injector.getAllBindings()
Returns a snapshot of this injector's bindings,
both explicit and just-in-time.
|
Map |
Injector.getBindings()
Returns this injector's
explicit bindings.
|
| Modifier and Type | Method and Description |
|---|---|
<T> LinkedBindingBuilder |
Binder.bind(Key
See the EDSL examples at
Binder.
|
protected <T> LinkedBindingBuilder |
AbstractModule.bind(Key
|
protected <T> LinkedBindingBuilder |
PrivateModule.bind(Key
|
void |
PrivateBinder.expose(Key
Makes the binding for
key available to the enclosing environment
|
protected <T> void |
PrivateModule.expose(Key
Makes the binding for
key available to other modules and the injector.
|
<T> Binding |
Injector.getBinding(Key
Returns the binding for the given injection key.
|
<T> Binding |
Injector.getExistingBinding(Key
Returns the binding if it already exists, or null if does not exist.
|
<T> T |
Injector.getInstance(Key
Returns the appropriate instance for the given injection key; equivalent to
getProvider(key).get().
|
<T> Provider |
Binder.getProvider(Key
Returns the provider used to obtain instances for the given injection key.
|
protected <T> Provider |
AbstractModule.getProvider(Key
|
<T> Provider |
Injector.getProvider(Key
Returns the provider used to obtain instances for the given injection key.
|
protected <T> Provider |
PrivateModule.getProvider(Key
|
protected void |
AbstractModule.requireBinding(Key
Adds a dependency from this module to
key.
|
protected void |
PrivateModule.requireBinding(Key
Instructs Guice to require a binding to the given key.
|
<T> Provider |
Scope.scope(Key
Scopes a provider.
|
| Modifier and Type | Method and Description |
|---|---|
ScopedBindingBuilder |
LinkedBindingBuilder.to(Key
See the EDSL examples at
Binder.
|
ScopedBindingBuilder |
LinkedBindingBuilder.toProvider(Key
See the EDSL examples at
Binder.
|
| Modifier and Type | Field and Description |
|---|---|
protected static Key |
AbstractBindingBuilder.NULL_KEY
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Key |
MoreTypes.canonicalizeKey(Key
Returns a key that doesn't hold any references to parent classes.
|
Key |
ProviderMethod.getKey()
|
Key |
BindingImpl.getKey()
|
Key |
ExposureBuilder.getKey()
|
static Key |
Annotations.getKey(TypeLiteral
Gets a key for the given type, member and annotations.
|
Key |
LinkedBindingImpl.getLinkedKey()
|
| Modifier and Type | Method and Description |
|---|---|
Set |
PrivateElementsImpl.getExposedKeys()
|
| Modifier and Type | Method and Description |
|---|---|
Errors |
Errors.bindingAlreadySet(Key
|
static <T> Key |
MoreTypes.canonicalizeKey(Key
Returns a key that doesn't hold any references to parent classes.
|
Errors |
Errors.childBindingAlreadySet(Key
|
Errors |
Errors.errorCheckingDuplicateBinding(Key
|
Errors |
Errors.exposedButNotBound(Key
|
Object |
PrivateElementsImpl.getExposedSource(Key
|
Errors |
Errors.jitBindingAlreadySet(Key
|
Errors |
Errors.jitDisabled(Key
|
Errors |
Errors.jitDisabledInParent(Key
|
Errors |
Errors.missingImplementation(Key
We use a fairly generic error message here.
|
<T> Provider |
SingletonScope.scope(Key
Provides singleton scope with the following properties: - creates no more than one instance per Key as a creator is used no more than once, - result is cached and returned quickly on subsequent calls, - exception in a creator is not treated as instance creation and is not cached, - creates singletons in parallel whenever possible, - waits for dependent singletons to be created even across threads and when dependencies are shared as long as no circular dependencies are detected, - returns circular proxy only when circular dependencies are detected, - aside from that, blocking synchronization is only used for proxy creation and initialization,
|
BindingBuilder |
BindingBuilder.to(Key
|
BindingBuilder |
BindingBuilder.toProvider(Key
|
BindingImpl |
LinkedBindingImpl.withKey(Key
|
protected BindingImpl |
BindingImpl.withKey(Key
|
| Constructor and Description | |
|---|---|
AbstractBindingBuilder(Binder
|
|
BindingBuilder(Binder
|
|
BindingImpl(com
|
|
BindingImpl(Object
|
|
ExposedBindingImpl(com
|
|
ExposureBuilder(Binder
|
|
LinkedBindingImpl(com
|
|
LinkedBindingImpl(com
|
|
LinkedBindingImpl(Object
|
|
LinkedBindingImpl(Object
|
| Modifier and Type | Method and Description |
|---|---|
Key |
ProviderLookup.getKey()
|
Key |
ProvidesMethodBinding.getKey()
Returns the key of the binding.
|
Key |
Dependency.getKey()
Returns the key to the binding that satisfies this dependency.
|
Key |
LinkedKeyBinding.getLinkedKey()
Returns the linked key used to resolve injections.
|
Key |
ProviderBinding.getProvidedKey()
Returns the key whose binding is used to
provide instances.
|
Key |
ProviderKeyBinding.getProviderKey()
Returns the key used to resolve the provider's binding.
|
Key |
ConvertedConstantBinding.getSourceKey()
Returns the key for the source binding.
|
abstract <T> Key |
ModuleAnnotatedMethodScanner.prepareMethod(Binder
Prepares a method for binding.
|
| Modifier and Type | Method and Description |
|---|---|
Set |
PrivateElements.getExposedKeys()
Returns the unique exposed keys for these private elements.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Dependency |
Dependency.get(Key
Returns a new dependency that is not attached to an injection point.
|
Object |
PrivateElements.getExposedSource(Key
Returns an arbitrary object containing information about the "place" where this key was exposed.
|
<T> Provider |
TypeEncounter.getProvider(Key
Returns the provider used to obtain instances for the given injection key.
|
abstract <T> Key |
ModuleAnnotatedMethodScanner.prepareMethod(Binder
Prepares a method for binding.
|
| Constructor and Description | |
|---|---|
ProviderLookup(Object
|