Package | Description |
---|---|
com.google.inject |
Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.
|
com.google.inject.internal |
Guice (sounds like "juice")
|
com.google.inject.multibindings |
Extension for binding multiple instances in a collection; this extension requires
guice-multibindings.jar . |
com.google.inject.spi |
Guice service provider interface
|
Modifier and Type | Method and Description |
---|---|
<T> Binding<T> |
Injector.getBinding(Class<T> type)
Returns the binding for the given type.
|
<T> Binding<T> |
Injector.getBinding(Key<T> key)
Returns the binding for the given injection key.
|
<T> Binding<T> |
Injector.getExistingBinding(Key<T> key)
Returns the binding if it already exists, or null if does not exist.
|
Modifier and Type | Method and Description |
---|---|
<T> List<Binding<T>> |
Injector.findBindingsByType(TypeLiteral<T> type)
Returns all explicit bindings for
type . |
Map<Key<?>,Binding<?>> |
Injector.getAllBindings()
Returns a snapshot of this injector's bindings, both explicit and
just-in-time.
|
Map<Key<?>,Binding<?>> |
Injector.getBindings()
Returns this injector's explicit bindings.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
Scopes.isScoped(Binding<?> binding,
Scope scope,
Class<? extends Annotation> scopeAnnotation)
Returns true if
binding has the given scope. |
static boolean |
Scopes.isSingleton(Binding<?> binding)
Returns true if
binding is singleton-scoped. |
Modifier and Type | Method and Description |
---|---|
protected void |
AbstractModule.bindListener(Matcher<? super Binding<?>> bindingMatcher,
ProvisionListener... listener) |
protected void |
PrivateModule.bindListener(Matcher<? super Binding<?>> bindingMatcher,
ProvisionListener... listeners) |
void |
Binder.bindListener(Matcher<? super Binding<?>> bindingMatcher,
ProvisionListener... listeners)
Registers listeners for provisioned objects.
|
Modifier and Type | Class and Description |
---|---|
class |
BindingImpl<T> |
class |
ExposedBindingImpl<T> |
class |
LinkedBindingImpl<T> |
Modifier and Type | Method and Description |
---|---|
Binding<?> |
OptionalBinderBinding.getActualBinding()
Returns the actual binding (set by
OptionalBinder.setBinding() ) or null if not set. |
Binding<?> |
OptionalBinderBinding.getDefaultBinding()
Returns the default binding (set by
OptionalBinder.setDefault() ) if one exists or null if
no default binding is set. |
Modifier and Type | Method and Description |
---|---|
List<Binding<?>> |
MultibinderBinding.getElements()
Returns all bindings that make up the set.
|
List<Map.Entry<?,Binding<?>>> |
MapBinderBinding.getEntries()
Returns all entries in the Map.
|
List<Map.Entry<?,Binding<?>>> |
MapBinderBinding.getEntries(Iterable<? extends Element> elements)
Similar to
MapBinderBinding.getEntries() , but can be used on a MapBinderBinding retrieved from Elements.getElements(com.google.inject.Module...) . |
Modifier and Type | Interface and Description |
---|---|
interface |
ConstructorBinding<T>
A binding to the constructor of a concrete clss.
|
interface |
ConvertedConstantBinding<T>
A binding created from converting a bound instance to a new type.
|
interface |
ExposedBinding<T>
A binding to a key exposed from an enclosed private environment.
|
interface |
InstanceBinding<T>
A binding to a single instance.
|
interface |
LinkedKeyBinding<T>
A binding to a linked key.
|
interface |
ProviderBinding<T extends Provider<?>>
A binding to a
Provider that delegates to the binding for the provided type. |
interface |
ProviderInstanceBinding<T>
A binding to a provider instance.
|
interface |
ProviderKeyBinding<T>
A binding to a provider key.
|
interface |
UntargettedBinding<T>
An untargetted binding.
|
Modifier and Type | Method and Description |
---|---|
abstract Binding<T> |
ProvisionListener.ProvisionInvocation.getBinding()
Returns the Binding this is provisioning.
|
Modifier and Type | Method and Description |
---|---|
Matcher<? super Binding<?>> |
ProvisionListenerBinding.getBindingMatcher()
Returns the binding matcher which chooses which bindings the listener should be notified of.
|
Modifier and Type | Method and Description |
---|---|
<T> V |
ElementVisitor.visit(Binding<T> binding)
Visit a mapping from a key (type and optional annotation) to the strategy for getting instances
of the type.
|
<T> V |
DefaultElementVisitor.visit(Binding<T> binding) |
protected V |
DefaultBindingTargetVisitor.visitOther(Binding<? extends T> binding)
Default visit implementation.
|
Copyright © 2006–2018 Google, Inc.. All rights reserved.