Uses of Interface
com.google.inject.Binding
-
Packages that use Binding Package Description com.google.inject Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.com.google.inject.assistedinject Extension for combining factory interfaces with injection; this extension requiresguice-assistedinject.jar
.com.google.inject.grapher com.google.inject.internal Guice (sounds like "juice")com.google.inject.multibindings Extension for binding multiple instances in a collection; this extension requiresguice-multibindings.jar
.com.google.inject.servlet Servlet API scopes, bindings and registration; this extension requiresguice-servlet.jar
.com.google.inject.spi Guice service provider interfacecom.google.inject.tools.jmx JMX integration; this extension requiresguice-jmx.jar
.com.google.inject.util Helper methods for working with Guice. -
-
Uses of Binding in com.google.inject
Methods in com.google.inject that return Binding Modifier and Type Method Description <T> Binding<T>
Injector. getBinding(Key<T> key)
Returns the binding for the given injection key.<T> Binding<T>
Injector. getBinding(java.lang.Class<T> type)
Returns the binding for the given type.<T> Binding<T>
Injector. getExistingBinding(Key<T> key)
Returns the binding if it already exists, or null if does not exist.Methods in com.google.inject that return types with arguments of type Binding Modifier and Type Method Description <T> java.util.List<Binding<T>>
Injector. findBindingsByType(TypeLiteral<T> type)
Returns all explicit bindings fortype
.java.util.Map<Key<?>,Binding<?>>
Injector. getAllBindings()
Returns a snapshot of this injector's bindings, both explicit and just-in-time.java.util.Map<Key<?>,Binding<?>>
Injector. getBindings()
Returns this injector's explicit bindings.Methods in com.google.inject with parameters of type Binding Modifier and Type Method Description static boolean
Scopes. isScoped(Binding<?> binding, Scope scope, java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
Returns true ifbinding
has the given scope.static boolean
Scopes. isSingleton(Binding<?> binding)
Returns true ifbinding
is singleton-scoped.Method parameters in com.google.inject with type arguments of type Binding Modifier and Type Method Description protected void
AbstractModule. bindListener(Matcher<? super Binding<?>> bindingMatcher, ProvisionListener... listener)
void
Binder. bindListener(Matcher<? super Binding<?>> bindingMatcher, ProvisionListener... listeners)
Registers listeners for provisioned objects.protected void
PrivateModule. bindListener(Matcher<? super Binding<?>> bindingMatcher, ProvisionListener... listeners)
-
Uses of Binding in com.google.inject.assistedinject
Fields in com.google.inject.assistedinject declared as Binding Modifier and Type Field Description (package private) Binding<?>
FactoryProvider2.AssistData. cachedBinding
used to perform optimized factory creations.Methods in com.google.inject.assistedinject that return Binding Modifier and Type Method Description Binding<?>
FactoryProvider2. getBindingFromNewInjector(java.lang.reflect.Method method, java.lang.Object[] args, FactoryProvider2.AssistData data)
Creates a child injector that binds the args, and returns the binding for the method's result. -
Uses of Binding in com.google.inject.grapher
Methods in com.google.inject.grapher with type parameters of type Binding Modifier and Type Method Description private <T extends Binding<?> & HasDependencies>
java.util.Collection<Edge>DefaultEdgeCreator.EdgeVisitor. newDependencyEdges(NodeId nodeId, T binding)
Returns a dependency edge for eachDependency
in the binding.private <T extends Binding<?> & HasDependencies>
InstanceNodeDefaultNodeCreator.NodeVisitor. newInstanceNode(T binding, java.lang.Object instance)
Returns a new instance node for the givenBinding
.Methods in com.google.inject.grapher that return types with arguments of type Binding Modifier and Type Method Description private java.lang.Iterable<Binding<?>>
AbstractInjectorGrapher. getBindings(Injector injector, java.util.Set<Key<?>> root)
Returns the bindings for the root keys and their transitive dependencies.Methods in com.google.inject.grapher with parameters of type Binding Modifier and Type Method Description private ImplementationNode
DefaultNodeCreator.NodeVisitor. newImplementationNode(Binding<?> binding, java.util.Collection<java.lang.reflect.Member> members)
Returns a new implementation node for the given binding.private InterfaceNode
DefaultNodeCreator.NodeVisitor. newInterfaceNode(Binding<?> binding)
Returns a new interface node for the givenBinding
.java.util.Collection<Edge>
DefaultEdgeCreator.EdgeVisitor. visitOther(Binding<?> binding)
java.util.Collection<Node>
DefaultNodeCreator.NodeVisitor. visitOther(Binding<?> binding)
java.util.Collection<Key<?>>
TransitiveDependencyVisitor. visitOther(Binding<?> binding)
Method parameters in com.google.inject.grapher with type arguments of type Binding Modifier and Type Method Description java.lang.Iterable<Alias>
AliasCreator. createAliases(java.lang.Iterable<Binding<?>> bindings)
Returns aliases for the given dependency graph.java.lang.Iterable<Alias>
ProviderAliasCreator. createAliases(java.lang.Iterable<Binding<?>> bindings)
java.lang.Iterable<Edge>
DefaultEdgeCreator. getEdges(java.lang.Iterable<Binding<?>> bindings)
java.lang.Iterable<Edge>
EdgeCreator. getEdges(java.lang.Iterable<Binding<?>> bindings)
Returns edges for the given dependency graph.java.lang.Iterable<Node>
DefaultNodeCreator. getNodes(java.lang.Iterable<Binding<?>> bindings)
java.lang.Iterable<Node>
NodeCreator. getNodes(java.lang.Iterable<Binding<?>> bindings)
Returns nodes for the given dependency graph. -
Uses of Binding in com.google.inject.internal
Classes in com.google.inject.internal that implement Binding Modifier and Type Class Description class
BindingImpl<T>
(package private) class
ConstructorBindingImpl<T>
(package private) class
ExposedBindingImpl<T>
private static class
InjectorImpl.ConvertedConstantBindingImpl<T>
private static class
InjectorImpl.SyntheticProviderBindingImpl<T>
A framework-created JIT Providerbinding. (package private) class
InstanceBindingImpl<T>
(package private) class
InternalProviderInstanceBindingImpl<T>
AProviderInstanceBindingImpl
for implementing 'native' guice extensions.(package private) class
LinkedBindingImpl<T>
(package private) class
LinkedProviderBindingImpl<T>
(package private) class
ProviderInstanceBindingImpl<T>
(package private) class
UntargettedBindingImpl<T>
Fields in com.google.inject.internal declared as Binding Modifier and Type Field Description private Binding<?>
BindingAlreadySetError. binding
(package private) Binding<T>
DuplicateElementError.Element. binding
(package private) Binding<?>
ProvisionListenerCallbackStore.KeyBinding. binding
private Binding<T>
ProvisionListenerStackCallback. binding
private Binding<V>[]
RealMapBinder.MultimapBinder.RealMultimapProvider.PerKeyData. bindings
private Binding<?>
BindingAlreadySetError. original
(package private) Binding<java.lang.String>
InjectorImpl.ConvertedConstantBindingImpl. originalBinding
Fields in com.google.inject.internal with type parameters of type Binding Modifier and Type Field Description private com.google.common.collect.ImmutableList<Binding<T>>
RealMultibinder.BindingSelection. bindings
(package private) java.util.List<Binding<T>>
RealMultibinder.RealMultibinderProvider. bindings
private com.google.common.collect.Multimap<K,Binding<V>>
DuplicateMapKeyError. duplicates
private com.google.common.collect.ImmutableList<java.util.Map.Entry<K,Binding<V>>>
RealMapBinder.BindingSelection. entries
private java.util.Map<Key<?>,Binding<?>>
InjectorBindingData. explicitBindings
private java.util.Map<Key<?>,Binding<?>>
InjectorBindingData. explicitBindingsMutable
private com.google.common.collect.ListMultimap<TypeLiteral<?>,Binding<?>>
InjectorBindingData. indexedExplicitBindings
private com.google.common.collect.ImmutableMap<K,Binding<V>>
RealMapBinder.BindingSelection. mapBindings
These are built during initialization and used by all factories to actually provide the relevant maps.private com.google.common.collect.ImmutableMap<K,java.util.Set<Binding<V>>>
RealMapBinder.BindingSelection. multimapBindings
Methods in com.google.inject.internal that return Binding Modifier and Type Method Description Binding<?>
RealOptionalBinder.JavaOptionalProvider. getActualBinding()
Binding<?>
RealOptionalBinder.RealOptionalKeyProvider. getActualBinding()
<T> Binding<T>
InjectorImpl. getBinding(java.lang.Class<T> type)
<T> Binding<T>
InternalInjectorCreator.ToolStageInjector. getBinding(Key<T> key)
<T> Binding<T>
InternalInjectorCreator.ToolStageInjector. getBinding(java.lang.Class<T> type)
Binding<T>
ProvisionListenerStackCallback.Provision. getBinding()
Binding<?>
RealOptionalBinder.JavaOptionalProvider. getDefaultBinding()
Binding<?>
RealOptionalBinder.RealOptionalKeyProvider. getDefaultBinding()
<T> Binding<T>
InternalInjectorCreator.ToolStageInjector. getExistingBinding(Key<T> key)
Methods in com.google.inject.internal that return types with arguments of type Binding Modifier and Type Method Description <T> java.util.List<Binding<T>>
InjectorImpl. findBindingsByType(TypeLiteral<T> type)
<T> java.util.List<Binding<T>>
InternalInjectorCreator.ToolStageInjector. findBindingsByType(TypeLiteral<T> type)
java.util.Map<Key<?>,Binding<?>>
InjectorImpl. getAllBindings()
java.util.Map<Key<?>,Binding<?>>
InternalInjectorCreator.ToolStageInjector. getAllBindings()
java.util.Map<Key<?>,Binding<?>>
InjectorImpl. getBindings()
java.util.Map<Key<?>,Binding<?>>
InternalInjectorCreator.ToolStageInjector. getBindings()
(package private) com.google.common.collect.ImmutableList<Binding<T>>
RealMultibinder.BindingSelection. getBindings()
(package private) java.util.List<Binding<?>>
RealMultibinder.BindingSelection. getElements()
java.util.List<Binding<?>>
RealMultibinder.ExtensionRealMultibinderProvider. getElements()
private com.google.common.collect.ImmutableList<java.util.Map.Entry<K,Binding<V>>>
RealMapBinder.BindingSelection. getEntries()
java.util.List<java.util.Map.Entry<?,Binding<?>>>
RealMapBinder.ExtensionRealMapProvider. getEntries()
java.util.List<java.util.Map.Entry<?,Binding<?>>>
RealMapBinder.ExtensionRealMapProvider. getEntries(java.lang.Iterable<? extends Element> elements)
java.util.Map<Key<?>,Binding<?>>
InjectorBindingData. getExplicitBindingsThisLevel()
com.google.common.collect.ListMultimap<TypeLiteral<?>,Binding<?>>
InjectorBindingData. getIndexedExplicitBindings()
private com.google.common.collect.ImmutableMap<K,Binding<V>>
RealMapBinder.BindingSelection. getMapBindings()
private com.google.common.collect.ImmutableMap<K,java.util.Set<Binding<V>>>
RealMapBinder.BindingSelection. getMultimapBindings()
Methods in com.google.inject.internal with parameters of type Binding Modifier and Type Method Description (package private) Errors
Errors. bindingAlreadySet(Binding<?> binding, Binding<?> original)
private <T> ProvisionListenerStackCallback<T>
ProvisionListenerCallbackStore. create(Binding<T> binding)
Creates a newProvisionListenerStackCallback
with the correct listeners for the key.(package private) static <T> InternalFactory<Provider<T>>
InjectorImpl.SyntheticProviderBindingImpl. createInternalFactory(Binding<T> providedBinding)
private static <K,V>
InternalProvisionExceptionRealMapBinder. createNullValueException(K key, Binding<V> binding)
<T> ProvisionListenerStackCallback<T>
ProvisionListenerCallbackStore. get(Binding<T> binding)
Returns a newProvisionListenerStackCallback
for the key ornull
if there are no listeners(package private) boolean
Indexer. isIndexable(Binding<?> binding)
(package private) boolean
ProvisionListenerCallbackStore. remove(Binding<?> type)
Purges a key from the cache.private void
InjectorImpl. removeFailedJitBinding(Binding<?> binding, InjectionPoint ip)
Cleans up any state that may have been cached when constructing the JIT binding.(package private) <T> Initializable<T>
Initializer. requestInjection(InjectorImpl injector, T instance, Binding<T> binding, java.lang.Object source, java.util.Set<InjectionPoint> injectionPoints)
Registers an instance for member injection when that step is performed.private java.lang.Object
Indexer. scope(Binding<?> binding)
<T> java.lang.Boolean
BindingProcessor. visit(Binding<T> command)
<T> java.lang.Boolean
UntargettedBindingProcessor. visit(Binding<T> binding)
Method parameters in com.google.inject.internal with type arguments of type Binding Modifier and Type Method Description <K,V>
ErrorsErrors. duplicateMapKey(Key<java.util.Map<K,V>> mapKey, com.google.common.collect.Multimap<K,Binding<V>> duplicates)
private static <K,V>
java.lang.StringDuplicateMapKeyError. getDuplicateKeysMessage(Key<java.util.Map<K,V>> mapKey, com.google.common.collect.Multimap<K,Binding<V>> duplicates)
(package private) static <T> com.google.common.collect.ImmutableMultimap<T,DuplicateElementError.Element<T>>
DuplicateElementError. indexElements(java.util.List<Binding<T>> bindings, T[] values)
private static <K,V>
voidRealMapBinder.BindingSelection. reportDuplicateKeysError(Key<java.util.Map<K,V>> mapKey, com.google.common.collect.Multimap<K,Binding<V>> duplicates, Errors errors)
Constructors in com.google.inject.internal with parameters of type Binding Constructor Description BindingAlreadySetError(Binding<?> binding, Binding<?> original, java.util.List<java.lang.Object> sources)
ConvertedConstantBindingImpl(InjectorImpl injector, Key<T> key, T value, Binding<java.lang.String> originalBinding, TypeConverterBinding typeConverterBinding)
Element(T value, Binding<T> binding)
IndexedBinding(Binding<?> binding, Indexer.BindingType type, java.lang.Object scope, java.lang.Object extraEquality)
KeyBinding(Key<?> key, Binding<?> binding)
PerKeyData(K key, Binding<V>[] bindings, SingleParameterInjector<V>[] injectors)
ProvisionListenerStackCallback(Binding<T> binding, java.util.List<ProvisionListener> listeners)
SyntheticProviderBindingImpl(InjectorImpl injector, Key<Provider<T>> key, Binding<T> providedBinding)
Constructor parameters in com.google.inject.internal with type arguments of type Binding Constructor Description DuplicateElementError(Key<java.util.Set<T>> setKey, java.util.List<Binding<T>> bindings, T[] values, java.util.List<java.lang.Object> sources)
DuplicateMapKeyError(Key<java.util.Map<K,V>> mapKey, com.google.common.collect.Multimap<K,Binding<V>> duplicates, java.util.List<java.lang.Object> sources)
-
Uses of Binding in com.google.inject.multibindings
Methods in com.google.inject.multibindings that return Binding Modifier and Type Method Description Binding<?>
OptionalBinderBinding. getActualBinding()
Returns the actual binding (set byOptionalBinder.setBinding()
) or null if not set.Binding<?>
OptionalBinderBinding. getDefaultBinding()
Returns the default binding (set byOptionalBinder.setDefault()
) if one exists or null if no default binding is set.Methods in com.google.inject.multibindings that return types with arguments of type Binding Modifier and Type Method Description java.util.List<Binding<?>>
MultibinderBinding. getElements()
Returns all bindings that make up the set.java.util.List<java.util.Map.Entry<?,Binding<?>>>
MapBinderBinding. getEntries()
Returns all entries in the Map.java.util.List<java.util.Map.Entry<?,Binding<?>>>
MapBinderBinding. getEntries(java.lang.Iterable<? extends Element> elements)
Similar toMapBinderBinding.getEntries()
, but can be used on a MapBinderBinding retrieved fromElements.getElements(com.google.inject.Module...)
. -
Uses of Binding in com.google.inject.servlet
Methods in com.google.inject.servlet with parameters of type Binding Modifier and Type Method Description static boolean
ServletScopes. isRequestScoped(Binding<?> binding)
Returns true ifbinding
is request-scoped. -
Uses of Binding in com.google.inject.spi
Subinterfaces of Binding in com.google.inject.spi Modifier and Type Interface 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 aProvider
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.Fields in com.google.inject.spi with type parameters of type Binding Modifier and Type Field Description private Matcher<? super Binding<?>>
ProvisionListenerBinding. bindingMatcher
Methods in com.google.inject.spi that return Binding Modifier and Type Method Description abstract Binding<T>
ProvisionListener.ProvisionInvocation. getBinding()
Returns the Binding this is provisioning.Methods in com.google.inject.spi that return types with arguments of type Binding Modifier and Type Method Description Matcher<? super Binding<?>>
ProvisionListenerBinding. getBindingMatcher()
Returns the binding matcher which chooses which bindings the listener should be notified of.Methods in com.google.inject.spi with parameters of type Binding Modifier and Type Method Description private static java.util.Optional<Message>
BindingSourceRestriction. check(Binding<?> binding)
<T> V
DefaultElementVisitor. visit(Binding<T> binding)
<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.protected V
DefaultBindingTargetVisitor. visitOther(Binding<? extends T> binding)
Default visit implementation.Method parameters in com.google.inject.spi with type arguments of type Binding Modifier and Type Method Description void
Elements.RecordingBinder. bindListener(Matcher<? super Binding<?>> bindingMatcher, ProvisionListener... listeners)
Constructor parameters in com.google.inject.spi with type arguments of type Binding Constructor Description ProvisionListenerBinding(java.lang.Object source, Matcher<? super Binding<?>> bindingMatcher, ProvisionListener[] listeners)
-
Uses of Binding in com.google.inject.tools.jmx
Fields in com.google.inject.tools.jmx declared as Binding Modifier and Type Field Description (package private) Binding<?>
ManagedBinding. binding
Constructors in com.google.inject.tools.jmx with parameters of type Binding Constructor Description ManagedBinding(Binding<?> binding)
-
Uses of Binding in com.google.inject.util
Methods in com.google.inject.util with parameters of type Binding Modifier and Type Method Description private Scope
Modules.OverrideModule. getScopeInstanceOrNull(Binding<?> binding)
-