Uses of Interface
com.google.inject.Binding
Packages that use Binding
Package
Description
Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.
Extension for combining factory interfaces with injection; this extension requires
guice-assistedinject.jar
.Guice (sounds like "juice")
Extension for binding multiple instances in a collection; this extension requires
guice-multibindings.jar
.Servlet API scopes, bindings and registration; this extension requires
guice-servlet.jar
.Guice service provider interface
JMX integration; this extension requires
guice-jmx.jar
.Helper methods for working with Guice.
-
Uses of Binding in com.google.inject
Methods in com.google.inject that return BindingModifier and TypeMethodDescription<T> Binding<T>
Injector.getBinding
(Key<T> key) Returns the binding for the given injection key.<T> Binding<T>
Injector.getBinding
(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 BindingModifier and TypeMethodDescriptionInjector.findBindingsByType
(TypeLiteral<T> type) Returns all explicit bindings fortype
.Injector.getAllBindings()
Returns a snapshot of this injector's bindings, both explicit and just-in-time.Injector.getBindings()
Returns this injector's explicit bindings.Methods in com.google.inject with parameters of type BindingModifier and TypeMethodDescriptionstatic boolean
Scopes.isScoped
(Binding<?> binding, Scope scope, Class<? extends 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 BindingModifier and TypeMethodDescriptionprotected 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 BindingModifier and TypeFieldDescription(package private) Binding<?>
FactoryProvider2.AssistData.cachedBinding
used to perform optimized factory creations.Methods in com.google.inject.assistedinject that return BindingModifier and TypeMethodDescriptionBinding<?>
FactoryProvider2.getBindingFromNewInjector
(Method method, 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 BindingModifier and TypeMethodDescriptionprivate <T extends Binding<?> & HasDependencies>
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, Object instance) Returns a new instance node for the givenBinding
.Methods in com.google.inject.grapher that return types with arguments of type BindingModifier and TypeMethodDescriptionAbstractInjectorGrapher.getBindings
(Injector injector, Set<Key<?>> root) Returns the bindings for the root keys and their transitive dependencies.Methods in com.google.inject.grapher with parameters of type BindingModifier and TypeMethodDescriptionprivate ImplementationNode
DefaultNodeCreator.NodeVisitor.newImplementationNode
(Binding<?> binding, Collection<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
.DefaultEdgeCreator.EdgeVisitor.visitOther
(Binding<?> binding) DefaultNodeCreator.NodeVisitor.visitOther
(Binding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visitOther
(Binding<?> binding) Method parameters in com.google.inject.grapher with type arguments of type BindingModifier and TypeMethodDescriptionAliasCreator.createAliases
(Iterable<Binding<?>> bindings) Returns aliases for the given dependency graph.ProviderAliasCreator.createAliases
(Iterable<Binding<?>> bindings) Returns edges for the given dependency graph.Returns nodes for the given dependency graph. -
Uses of Binding in com.google.inject.internal
Classes in com.google.inject.internal that implement BindingModifier and TypeClassDescriptionclass
BindingImpl<T>
(package private) final class
final class
private static class
private static class
A framework-created JIT Providerbinding. (package private) final class
(package private) final class
AProviderInstanceBindingImpl
for implementing 'native' guice extensions.final class
(package private) final class
(package private) class
(package private) final class
Fields in com.google.inject.internal declared as BindingModifier and TypeFieldDescription(package private) final Binding<?>
ProvisionListenerCallbackStore.KeyBinding.binding
ProvisionListenerStackCallback.binding
RealMapBinder.MultimapBinder.RealMultimapProvider.PerKeyData.bindings
InjectorImpl.ConvertedConstantBindingImpl.originalBinding
Fields in com.google.inject.internal with type parameters of type BindingModifier and TypeFieldDescriptionRealMultibinder.BindingSelection.bindings
RealMultibinder.RealMultibinderProvider.bindings
(package private) final com.google.common.collect.ListMultimap<TypeLiteral<?>,
Binding<?>> InjectorImpl.bindingsMultimap
RealMapBinder.BindingSelection.entries
InheritingState.explicitBindings
InheritingState.explicitBindingsMutable
RealMapBinder.BindingSelection.mapBindings
These are built during initialization and used by all factories to actually provide the relevant maps.RealMapBinder.BindingSelection.multimapBindings
Methods in com.google.inject.internal that return BindingModifier and TypeMethodDescriptionBinding<?>
RealOptionalBinder.JavaOptionalProvider.getActualBinding()
Binding<?>
RealOptionalBinder.RealOptionalKeyProvider.getActualBinding()
<T> Binding<T>
InjectorImpl.getBinding
(Class<T> type) <T> Binding<T>
InternalInjectorCreator.ToolStageInjector.getBinding
(Key<T> key) <T> Binding<T>
InternalInjectorCreator.ToolStageInjector.getBinding
(Class<T> type) 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 BindingModifier and TypeMethodDescriptionInjectorImpl.findBindingsByType
(TypeLiteral<T> type) InternalInjectorCreator.ToolStageInjector.findBindingsByType
(TypeLiteral<T> type) InjectorImpl.getAllBindings()
InternalInjectorCreator.ToolStageInjector.getAllBindings()
InjectorImpl.getBindings()
InternalInjectorCreator.ToolStageInjector.getBindings()
RealMultibinder.BindingSelection.getBindings()
RealMultibinder.BindingSelection.getElements()
RealMultibinder.RealMultibinderProvider.getElements()
RealMapBinder.BindingSelection.getEntries()
RealMapBinder.RealMapProvider.getEntries()
RealMapBinder.RealMapProvider.getEntries
(Iterable<? extends Element> elements) InheritingState.getExplicitBindingsThisLevel()
State.getExplicitBindingsThisLevel()
Returns the explicit bindings at this level only.RealMapBinder.BindingSelection.getMapBindings()
RealMapBinder.BindingSelection.getMultimapBindings()
Methods in com.google.inject.internal with parameters of type BindingModifier and TypeMethodDescriptionprivate <T> ProvisionListenerStackCallback<T>
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> InternalProvisionException RealMapBinder.createNullValueException
(K key, Binding<V> binding) Returns a newProvisionListenerStackCallback
for the key ornull
if there are no listeners(package private) boolean
Indexer.isIndexable
(Binding<?> binding) (package private) boolean
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, Object source, Set<InjectionPoint> injectionPoints) Registers an instance for member injection when that step is performed.private Object
<T> Boolean
<T> Boolean
Method parameters in com.google.inject.internal with type arguments of type BindingModifier and TypeMethodDescriptionprivate static <K,
V> void RealMapBinder.BindingSelection.reportDuplicateKeysError
(com.google.common.collect.Multimap<K, Binding<V>> duplicates, Errors errors) Constructors in com.google.inject.internal with parameters of type BindingModifierConstructorDescription(package private)
ConvertedConstantBindingImpl
(InjectorImpl injector, Key<T> key, T value, Binding<String> originalBinding, TypeConverterBinding typeConverterBinding) (package private)
IndexedBinding
(Binding<?> binding, Indexer.BindingType type, Object scope, Object extraEquality) (package private)
KeyBinding
(Key<?> key, Binding<?> binding) private
PerKeyData
(K key, Binding<V>[] bindings, SingleParameterInjector<V>[] injectors) ProvisionListenerStackCallback
(Binding<T> binding, List<ProvisionListener> listeners) (package private)
SyntheticProviderBindingImpl
(InjectorImpl injector, Key<Provider<T>> key, Binding<T> providedBinding) -
Uses of Binding in com.google.inject.multibindings
Methods in com.google.inject.multibindings that return BindingModifier and TypeMethodDescriptionBinding<?>
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 BindingModifier and TypeMethodDescriptionMultibinderBinding.getElements()
Returns all bindings that make up the set.MapBinderBinding.getEntries()
Returns all entries in the Map.MapBinderBinding.getEntries
(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 BindingModifier and TypeMethodDescriptionstatic 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.spiModifier and TypeInterfaceDescriptioninterface
A binding to the constructor of a concrete clss.interface
A binding created from converting a bound instance to a new type.interface
A binding to a key exposed from an enclosed private environment.interface
A binding to a single instance.interface
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
A binding to a provider instance.interface
A binding to a provider key.interface
An untargetted binding.Fields in com.google.inject.spi with type parameters of type BindingMethods in com.google.inject.spi that return BindingModifier and TypeMethodDescriptionProvisionListener.ProvisionInvocation.getBinding()
Returns the Binding this is provisioning.Methods in com.google.inject.spi that return types with arguments of type BindingModifier and TypeMethodDescriptionProvisionListenerBinding.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 BindingModifier and TypeMethodDescription<T> V
<T> V
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 BindingModifier and TypeMethodDescriptionvoid
Elements.RecordingBinder.bindListener
(Matcher<? super Binding<?>> bindingMatcher, ProvisionListener... listeners) Constructor parameters in com.google.inject.spi with type arguments of type BindingModifierConstructorDescription(package private)
ProvisionListenerBinding
(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 BindingConstructors in com.google.inject.tools.jmx with parameters of type Binding -
Uses of Binding in com.google.inject.util
Methods in com.google.inject.util with parameters of type BindingModifier and TypeMethodDescriptionprivate Scope
Modules.OverrideModule.getScopeInstanceOrNull
(Binding<?> binding)