Uses of Class
com.google.inject.Key
Packages that use Key
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
.Interfaces which make up
Binder
's expression language.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
Extension for injecting objects that may throw at provision time; this extension requires
guice-throwingproviders.jar
.-
Uses of Key in com.google.inject
Methods in com.google.inject that return KeyModifier and TypeMethodDescriptionstatic <T> Key<T>
Key.get
(TypeLiteral<T> typeLiteral) Gets a key for an injection type.static <T> Key<T>
Key.get
(TypeLiteral<T> typeLiteral, Annotation annotation) Gets a key for an injection type and an annotation.static <T> Key<T>
Key.get
(TypeLiteral<T> typeLiteral, Class<? extends Annotation> annotationType) Gets a key for an injection type and an annotation type.static <T> Key<T>
Gets a key for an injection type.(package private) static <T> Key<T>
Key.get
(Class<T> type, Key.AnnotationStrategy annotationStrategy) Gets a key for an injection type and an annotation strategy.static <T> Key<T>
Key.get
(Class<T> type, Annotation annotation) Gets a key for an injection type and an annotation.static <T> Key<T>
Key.get
(Class<T> type, Class<? extends Annotation> annotationType) Gets a key for an injection type and an annotation type.static Key<?>
Gets a key for an injection type.static Key<?>
Key.get
(Type type, Annotation annotation) Gets a key for an injection type and an annotation.static Key<?>
Key.get
(Type type, Class<? extends Annotation> annotationType) Gets a key for an injection type and an annotation type.Binding.getKey()
Returns the key for this binding.<T> Key<T>
Key.ofType
(TypeLiteral<T> type) Returns a new key of the specified type with the same annotation as this key.<T> Key<T>
Returns a new key of the specified type with the same annotation as this key.Key<?>
Returns a new key of the specified type with the same annotation as this key.Key.providerKey()
Gets the key of this key's provider.Key.withoutAttributes()
Returns this key without annotation attributes, i.e.Methods in com.google.inject that return types with arguments of type KeyModifier and TypeMethodDescriptionInjector.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 KeyModifier and TypeMethodDescriptionprotected <T> LinkedBindingBuilder<T>
<T> LinkedBindingBuilder<T>
See the EDSL examples atBinder
.protected final <T> LinkedBindingBuilder<T>
void
Makes the binding forkey
available to the enclosing environmentprotected final <T> void
Makes the binding forkey
available to other modules and the injector.<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.<T> T
Injector.getInstance
(Key<T> key) Returns the appropriate instance for the given injection key; equivalent togetProvider(key).get()
.protected <T> Provider<T>
AbstractModule.getProvider
(Key<T> key) <T> Provider<T>
Binder.getProvider
(Key<T> key) Returns the provider used to obtain instances for the given injection key.<T> Provider<T>
Injector.getProvider
(Key<T> key) Returns the provider used to obtain instances for the given injection key.protected final <T> Provider<T>
PrivateModule.getProvider
(Key<T> key) protected void
AbstractModule.requireBinding
(Key<?> key) Adds a dependency from this module tokey
.protected final void
PrivateModule.requireBinding
(Key<?> key) Instructs Guice to require a binding to the given key.<T> Provider<T>
Scopes a provider. -
Uses of Key in com.google.inject.assistedinject
Fields in com.google.inject.assistedinject declared as KeyModifier and TypeFieldDescriptionFactoryProvider2.factoryKey
The key that this is bound to.(package private) final Key<?>
FactoryProvider2.AssistData.returnType
the return type in the factory method that the constructor is bound to.Fields in com.google.inject.assistedinject with type parameters of type KeyModifier and TypeFieldDescriptionprivate final Map<Key<?>,
TypeLiteral<?>> BindingCollector.bindings
(package private) final com.google.common.collect.ImmutableList<Key<?>>
FactoryProvider2.AssistData.paramTypes
the parameters in the factory method associated with this data.Methods in com.google.inject.assistedinject that return KeyModifier and TypeMethodDescriptionprivate <T> Key<T>
Returns a key similar tokey
, but with an @Assisted binding annotation.Key<?>
Parameter.fixAnnotations
(Key<?> key) Replace annotation instances with annotation types, this is only appropriate for testing if a key is bound and not for injecting.private Key<?>
Parameter.getBindingForType
(Type type) AssistedInjectBinding.getKey()
Returns theKey
for the factory binding.FactoryProvider2.getKey()
(package private) Key<?>
Parameter.getPrimaryBindingKey()
Methods in com.google.inject.assistedinject that return types with arguments of type KeyMethods in com.google.inject.assistedinject with parameters of type KeyModifier and TypeMethodDescriptionBindingCollector.addBinding
(Key<?> key, TypeLiteral<?> target) private <T> Key<T>
Returns a key similar tokey
, but with an @Assisted binding annotation.<F> Module
private <T> InjectionPoint
FactoryProvider2.findMatchingConstructorInjectionPoint
(Method method, Key<?> returnType, TypeLiteral<T> implementation, List<Key<?>> paramList) Finds a constructor suitable for the method.Key<?>
Parameter.fixAnnotations
(Key<?> key) Replace annotation instances with annotation types, this is only appropriate for testing if a key is bound and not for injecting.FactoryModuleBuilder.implement
(Key<T> source, TypeLiteral<? extends T> target) See the factory configuration examples atFactoryModuleBuilder
.See the factory configuration examples atFactoryModuleBuilder
.private boolean
Method parameters in com.google.inject.assistedinject with type arguments of type KeyModifier and TypeMethodDescriptionprivate boolean
FactoryProvider2.constructorHasMatchingParams
(TypeLiteral<?> type, Constructor<?> constructor, List<Key<?>> paramList, Errors errors) Matching logic for constructors annotated with AssistedInject.private <T> InjectionPoint
FactoryProvider2.findMatchingConstructorInjectionPoint
(Method method, Key<?> returnType, TypeLiteral<T> implementation, List<Key<?>> paramList) Finds a constructor suitable for the method.Constructors in com.google.inject.assistedinject with parameters of type KeyModifierConstructorDescription(package private)
AssistData
(Constructor<?> constructor, Key<?> returnType, com.google.common.collect.ImmutableList<Key<?>> paramTypes, TypeLiteral<?> implementationType, Method factoryMethod, Set<Dependency<?>> dependencies, boolean optimized, List<FactoryProvider2.ThreadLocalProvider> providers) (package private)
FactoryProvider2
(Key<F> factoryKey, BindingCollector collector) Constructor parameters in com.google.inject.assistedinject with type arguments of type KeyModifierConstructorDescription(package private)
AssistData
(Constructor<?> constructor, Key<?> returnType, com.google.common.collect.ImmutableList<Key<?>> paramTypes, TypeLiteral<?> implementationType, Method factoryMethod, Set<Dependency<?>> dependencies, boolean optimized, List<FactoryProvider2.ThreadLocalProvider> providers) -
Uses of Key in com.google.inject.binder
Methods in com.google.inject.binder with parameters of type KeyModifier and TypeMethodDescriptionSee the EDSL examples atBinder
.LinkedBindingBuilder.toProvider
(Key<? extends javax.inject.Provider<? extends T>> providerKey) See the EDSL examples atBinder
. -
Uses of Key in com.google.inject.grapher
Fields in com.google.inject.grapher declared as KeyModifier and TypeFieldDescriptionprivate final Key<?>
NodeId.key
DefaultRootKeySetCreator.loggerKey
Methods in com.google.inject.grapher that return KeyMethods in com.google.inject.grapher that return types with arguments of type KeyModifier and TypeMethodDescriptionDefaultRootKeySetCreator.getRootKeys
(Injector injector) RootKeySetCreator.getRootKeys
(Injector injector) Returns the set of starting keys to graph.Collection<Key<?>>
TransitiveDependencyVisitor.visit
(ConstructorBinding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visit
(ConvertedConstantBinding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visit
(InstanceBinding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visit
(LinkedKeyBinding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visit
(ProviderBinding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visit
(ProviderInstanceBinding<?> binding) Collection<Key<?>>
TransitiveDependencyVisitor.visit
(ProviderKeyBinding<?> binding) private Collection<Key<?>>
TransitiveDependencyVisitor.visitHasDependencies
(HasDependencies hasDependencies) Collection<Key<?>>
TransitiveDependencyVisitor.visitOther
(Binding<?> binding) Methods in com.google.inject.grapher with parameters of type KeyModifier and TypeMethodDescriptionNameFactory.getAnnotationName
(Key<?> key) ShortNameFactory.getAnnotationName
(Key<?> key) NameFactory.getClassName
(Key<?> key) ShortNameFactory.getClassName
(Key<?> key) static NodeId
NodeId.newInstanceId
(Key<?> key) static NodeId
Method parameters in com.google.inject.grapher with type arguments of type KeyModifier and TypeMethodDescriptionAbstractInjectorGrapher.getBindings
(Injector injector, Set<Key<?>> root) Returns the bindings for the root keys and their transitive dependencies.final void
void
Graphs the guice dependency graph for the given injector using the given starting keys and their transitive dependencies.Constructors in com.google.inject.grapher with parameters of type Key -
Uses of Key in com.google.inject.internal
Fields in com.google.inject.internal declared as KeyModifier and TypeFieldDescriptionRealOptionalBinder.BindingSelection.actualBindingKey
lazily allocated, byRealOptionalBinder.BindingSelection.getKeyForActualBinding()
.private Key<Collection<javax.inject.Provider<T>>>
RealMultibinder.BindingSelection.collectionOfJavaxProvidersKey
private Key<Collection<Provider<T>>>
RealMultibinder.BindingSelection.collectionOfProvidersKey
RealOptionalBinder.BindingSelection.defaultBindingKey
lazily allocated, byRealOptionalBinder.BindingSelection.getKeyForDefaultBinding()
.RealMapBinder.BindingSelection.entrySetJavaxProviderKey
private Key<Map<K,
Collection<javax.inject.Provider<V>>>> RealMapBinder.BindingSelection.javaxProviderCollectionMultimapKey
RealMapBinder.BindingSelection.javaxProviderMapKey
RealMapBinder.BindingSelection.javaxProviderSetMultimapKey
AbstractBindingProcessor.Processor.key
BindingImpl.key
private final Key<?>
ConstructorBindingImpl.Factory.key
ExposedKeyFactory.key
ExposureBuilder.key
FactoryProxy.key
Initializer.InjectableReference.key
ProviderMethod.key
(package private) final Key<?>
ProvisionListenerCallbackStore.KeyBinding.key
RealMultibinder.PermitDuplicatesModule.key
RealOptionalBinder.BindingSelection.key
(package private) final Key<?>
WeakKeySet.KeyAndSource.key
RealMapBinder.BindingSelection.mapKey
RealMapBinder.RealMultimapBinderProviderWithDependencies.mapKey
RealMapBinder.BindingSelection.multimapKey
protected static final Key<?>
AbstractBindingBuilder.NULL_KEY
RealOptionalBinder.JavaOptionalProvider.optionalKey
RealOptionalBinder.RealOptionalKeyProvider.optionalKey
RealMultibinder.BindingSelection.permitDuplicatesKey
RealMapBinder.BindingSelection.providerCollectionMultimapKey
BoundProviderFactory.providerKey
LinkedProviderBindingImpl.providerKey
ProvidedByInternalFactory.providerKey
RealMapBinder.BindingSelection.providerMapKey
RealMapBinder.BindingSelection.providerSetMultimapKey
RealMultibinder.BindingSelection.setKey
FactoryProxy.targetKey
LinkedBindingImpl.targetKey
RealOptionalBinder.RealDirectTypeProvider.targetKey
RealMapBinder.ProviderMapEntry.valueKey
Fields in com.google.inject.internal with type parameters of type KeyModifier and TypeFieldDescriptionWeakKeySet.backingMap
private static final CycleDetectingLock.CycleDetectingLockFactory<Key<?>>
SingletonScope.cycleDetectingLockFactory
Allows us to detect when circular proxies are necessary.InheritingState.explicitBindings
InheritingState.explicitBindingsMutable
PrivateElementsImpl.exposedKeysToSources
lazily instantiatedInjectorImpl.failedJitBindings
Cache of Keys that we were unable to create JIT bindings for, so we don't keep trying.private static final com.google.common.collect.ImmutableSet<Key<?>>
ProvisionListenerCallbackStore.INTERNAL_BINDINGS
(package private) final Map<Key<?>,
BindingImpl<?>> InjectorImpl.jitBindings
Just-in-time binding cache.Methods in com.google.inject.internal that return KeyModifier and TypeMethodDescriptionstatic <T> Key<T>
MoreTypes.canonicalizeKey
(Key<T> key) Returns a key that doesn't hold any references to parent classes.(package private) Key<Collection<javax.inject.Provider<T>>>
RealMultibinder.BindingSelection.getCollectionOfJavaxProvidersKey()
(package private) Key<Collection<Provider<T>>>
RealMultibinder.BindingSelection.getCollectionOfProvidersKey()
RealOptionalBinder.BindingSelection.getDirectKey()
RealMapBinder.BindingSelection.getEntrySetJavaxProviderKey()
private Key<Map<K,
Collection<javax.inject.Provider<V>>>> RealMapBinder.BindingSelection.getJavaxProviderCollectionMultimapKey()
RealMapBinder.BindingSelection.getJavaxProviderMapKey()
RealMapBinder.BindingSelection.getJavaxProviderSetMultimapKey()
static Key<?>
Annotations.getKey
(TypeLiteral<?> type, Member member, Annotation[] annotations, Errors errors) Gets a key for the given type, member and annotations.BindingImpl.getKey()
Key<?>
ExposureBuilder.getKey()
ProviderMethod.getKey()
(package private) <T> Key<T>
ProviderMethodsModule.getKey
(Errors errors, TypeLiteral<T> type, Member member, Annotation[] annotations) RealOptionalBinder.JavaOptionalProvider.getKey()
RealOptionalBinder.RealOptionalKeyProvider.getKey()
RealOptionalBinder.BindingSelection.getKeyForActualBinding()
RealOptionalBinder.getKeyForActualBinding()
Returns the key to use for the actual binding, overrides the default if set.RealOptionalBinder.BindingSelection.getKeyForDefaultBinding()
RealOptionalBinder.getKeyForDefaultBinding()
Returns the key to use for the default binding.RealMultibinder.getKeyForNewItem()
Adds a new entry to the set and returns the key for it.RealMapBinder.getKeyForNewValue
(K key) Adds a binding to the map for the given key.RealMapBinder.getKeyOfProvider
(Key<T> valueKey) Given a Keywill return a Key<Provider > LinkedBindingImpl.getLinkedKey()
RealMapBinder.BindingSelection.getMapKey()
RealMapBinder.RealMapProvider.getMapKey()
RealMapBinder.BindingSelection.getMultimapKey()
RealMultibinder.BindingSelection.getPermitDuplicatesKey()
private static <T> Key<T>
InjectorImpl.getProvidedKey
(Key<Provider<T>> key, Errors errors) InjectorImpl.SyntheticProviderBindingImpl.getProvidedKey()
RealMapBinder.BindingSelection.getProviderCollectionMultimapKey()
LinkedProviderBindingImpl.getProviderKey()
RealMapBinder.BindingSelection.getProviderMapKey()
RealMapBinder.BindingSelection.getProviderSetMultimapKey()
RealMultibinder.BindingSelection.getSetKey()
RealMultibinder.getSetKey()
RealMultibinder.RealMultibinderProvider.getSetKey()
InjectorImpl.ConvertedConstantBindingImpl.getSourceKey()
RealMapBinder.ProviderMapEntry.getValueKey()
<T> Key<T>
ProvidesMethodScanner.prepareMethod
(Binder binder, Annotation annotation, Key<T> key, InjectionPoint injectionPoint) RealOptionalBinder.providerOf
(Key<T> key) Methods in com.google.inject.internal that return types with arguments of type KeyModifier and TypeMethodDescriptionInjectorImpl.getAllBindings()
InternalInjectorCreator.ToolStageInjector.getAllBindings()
RealOptionalBinder.JavaOptionalProvider.getAlternateKeys()
RealOptionalBinder.RealOptionalKeyProvider.getAlternateKeys()
RealMapBinder.RealMapProvider.getAlternateMapKeys()
RealMultibinder.RealMultibinderProvider.getAlternateSetKeys()
InjectorImpl.getBindings()
InternalInjectorCreator.ToolStageInjector.getBindings()
InheritingState.getExplicitBindingsThisLevel()
State.getExplicitBindingsThisLevel()
Returns the explicit bindings at this level only.PrivateElementsImpl.getExposedKeys()
Methods in com.google.inject.internal with parameters of type KeyModifier and TypeMethodDescriptionvoid
private <T> void
BindingProcessor.bindExposed
(PrivateElements privateElements, Key<T> key) Errors.bindingAlreadySet
(Key<?> key, Object source) void
void
Forbids the corresponding injector from creating a binding tokey
.static <T> Key<T>
MoreTypes.canonicalizeKey
(Key<T> key) Returns a key that doesn't hold any references to parent classes.Errors.childBindingAlreadySet
(Key<?> key, Set<Object> sources) boolean
private <T> BindingImpl<T>
InjectorImpl.convertConstantStringBinding
(Key<T> key, Errors errors) Converts a constant string binding to the required type.(package private) static <T> ConstructorBindingImpl<T>
ConstructorBindingImpl.create
(InjectorImpl injector, Key<T> key, InjectionPoint constructorInjector, Object source, Scoping scoping, Errors errors, boolean failIfNotLinked, boolean failIfNotExplicit) (package private) static <T> ProviderMethod<T>
ProviderMethod.create
(Key<T> key, Method method, Object instance, com.google.common.collect.ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, boolean skipFastClassGeneration, Annotation annotation) Creates aProviderMethod
.private <T> BindingImpl<T>
InjectorImpl.createImplementedByBinding
(Key<T> key, Scoping scoping, ImplementedBy implementedBy, Errors errors) Creates a binding for a type annotated with @ImplementedBy.private <T> BindingImpl<T>
InjectorImpl.createJustInTimeBinding
(Key<T> key, Errors errors, boolean jitDisabled, InjectorImpl.JitLimitation jitType) Returns a new just-in-time binding created by resolvingkey
.private <T> BindingImpl<T>
InjectorImpl.createJustInTimeBindingRecursive
(Key<T> key, Errors errors, boolean jitDisabled, InjectorImpl.JitLimitation jitType) Attempts to create a just-in-time binding forkey
in the root injector, falling back to other ancestor injectors until this injector is tried.private <T> BindingImpl<MembersInjector<T>>
InjectorImpl.createMembersInjectorBinding
(Key<MembersInjector<T>> key, Errors errors) (package private) <T> BindingImpl<T>
InjectorImpl.createProvidedByBinding
(Key<T> key, Scoping scoping, ProvidedBy providedBy, Errors errors) Creates a binding for a type annotated with @ProvidedBy.private <T> BindingImpl<Provider<T>>
InjectorImpl.createSyntheticProviderBinding
(Key<Provider<T>> key, Errors errors) Creates a synthetic binding toProvider<T>
, i.e.private <T> BindingImpl<TypeLiteral<T>>
InjectorImpl.createTypeLiteralBinding
(Key<TypeLiteral<T>> key, Errors errors) Converts a binding for aKey<TypeLiteral<T>>
to the valueTypeLiteral<T>
.(package private) <T> BindingImpl<T>
InjectorImpl.createUninitializedBinding
(Key<T> key, Scoping scoping, Object source, Errors errors, boolean jitBinding) Creates a binding for an injectable type with the given scope.(package private) static <T> LinkedProviderBindingImpl<T>
LinkedProviderBindingImpl.createWithInitializer
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Scoping scoping, Key<? extends javax.inject.Provider<? extends T>> providerKey, DelayedInitialize delayedInitializer) Errors.errorCheckingDuplicateBinding
(Key<?> key, Object source, Throwable t) Errors.exposedButNotBound
(Key<?> key) <T> BindingImpl<T>
InjectorImpl.getBinding
(Key<T> key) Returns the binding forkey
<T> Binding<T>
InternalInjectorCreator.ToolStageInjector.getBinding
(Key<T> key) (package private) <T> BindingImpl<T>
InjectorImpl.getBindingOrThrow
(Key<T> key, Errors errors, InjectorImpl.JitLimitation jitType) Gets a binding implementation.<T> BindingImpl<T>
InjectorImpl.getExistingBinding
(Key<T> key) <T> Binding<T>
InternalInjectorCreator.ToolStageInjector.getExistingBinding
(Key<T> key) <T> BindingImpl<T>
InheritingState.getExplicitBinding
(Key<T> key) <T> BindingImpl<T>
State.getExplicitBinding
(Key<T> key) Gets a binding which was specified explicitly in a module, or null.PrivateElementsImpl.getExposedSource
(Key<?> key) <T> T
InjectorImpl.getInstance
(Key<T> key) <T> T
InternalInjectorCreator.ToolStageInjector.getInstance
(Key<T> key) (package private) <T> InternalFactory<? extends T>
InjectorImpl.getInternalFactory
(Key<T> key, Errors errors, InjectorImpl.JitLimitation jitType) private <T> BindingImpl<T>
InjectorImpl.getJustInTimeBinding
(Key<T> key, Errors errors, InjectorImpl.JitLimitation jitType) Returns a just-in-time binding forkey
, creating it if necessary.RealMapBinder.getKeyOfProvider
(Key<T> valueKey) Given a Keywill return a Key<Provider > private static <T> Key<T>
InjectorImpl.getProvidedKey
(Key<Provider<T>> key, Errors errors) <T> Provider<T>
DeferredLookups.getProvider
(Key<T> key) <T> Provider<T>
EncounterImpl.getProvider
(Key<T> key) <T> Provider<T>
InjectorImpl.getProvider
(Key<T> key) <T> Provider<T>
InternalInjectorCreator.ToolStageInjector.getProvider
(Key<T> key) <T> Provider<T>
Lookups.getProvider
(Key<T> key) WeakKeySet.getSources
(Key<?> key) InheritingState.getSourcesForBlacklistedKey
(Key<?> key) State.getSourcesForBlacklistedKey
(Key<?> key) Returns the source of a blacklisted key.(package private) void
MembersInjectorImpl.injectAndNotify
(T instance, Key<T> key, ProvisionListenerStackCallback<T> provisionCallback, Object source, boolean toolableOnly) protected <T> UntargettedBindingImpl<T>
AbstractBindingProcessor.invalidBinding
(InjectorImpl injector, Key<T> key, Object source) boolean
InheritingState.isBlacklisted
(Key<?> key) boolean
State.isBlacklisted
(Key<?> key) Returns true ifkey
is forbidden from being bound in this injector.private static boolean
InjectorImpl.isMembersInjector
(Key<?> key) Returns true if the key type is MembersInjector (but not a subclass of MembersInjector).private static boolean
InjectorImpl.isProvider
(Key<?> key) Returns true if the key type is Provider (but not a subclass of Provider).private static boolean
InjectorImpl.isTypeLiteral
(Key<?> key) Errors.jitBindingAlreadySet
(Key<?> key) Errors.jitDisabled
(Key<?> key) static InternalProvisionException
InternalProvisionException.jitDisabled
(Key<?> key) Errors.jitDisabledInParent
(Key<?> key) private boolean
RealMultibinder.BindingSelection.keyMatches
(Key<?> key) private boolean
RealMapBinder.BindingSelection.matchesValueKey
(Key<?> key) Returns true if the key indicates this is a value in the map.Errors.missingImplementation
(Key key) We use a fairly generic error message here.(package private) <T> Errors
Errors.missingImplementationWithHint
(Key<T> key, Injector injector) Within guice's core, allow for better missing binding messagesstatic String
Returns the name the binding should use.(package private) static <K,
V> RealMapBinder<K, V> RealMapBinder.newRealMapBinder
(Binder binder, TypeLiteral<K> keyType, Key<V> valueTypeAndAnnotation) private static <K,
V> RealMapBinder<K, V> RealMapBinder.newRealMapBinder
(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Key<Map<K, V>> mapKey, RealMultibinder<Map.Entry<K, Provider<V>>> entrySetBinder) static <T> RealOptionalBinder<T>
RealOptionalBinder.newRealOptionalBinder
(Binder binder, Key<T> type) static <T> RealMultibinder<T>
RealMultibinder.newRealSetBinder
(Binder binder, Key<T> key) Implementation of newSetBinder.<T> Key<T>
ProvidesMethodScanner.prepareMethod
(Binder binder, Annotation annotation, Key<T> key, InjectionPoint injectionPoint) RealOptionalBinder.providerOf
(Key<T> key) (package private) void
Adds to the state without setting the dependency.void
InheritingState.putBinding
(Key<?> key, BindingImpl<?> binding) void
State.putBinding
(Key<?> key, BindingImpl<?> binding) (package private) static <T> InternalFactory<? extends T>
Scoping.scope
(Key<T> key, InjectorImpl injector, InternalFactory<? extends T> creator, Object source, Scoping scoping) Scopes an internal factory.<T> Provider<T>
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 initializationBindingBuilder.toProvider
(Key<? extends javax.inject.Provider<? extends T>> providerKey) private <T> void
AbstractBindingProcessor.validateKey
(Object source, Key<T> key) protected BindingImpl<T>
protected BindingImpl<T>
Method parameters in com.google.inject.internal with type arguments of type KeyModifier and TypeMethodDescriptionprivate boolean
InjectorImpl.cleanup
(BindingImpl<?> binding, Set<Key> encountered) Iterates through the binding's dependencies to clean up any stray bindings that were leftover from a failed JIT binding.Constructors in com.google.inject.internal with parameters of type KeyModifierConstructorDescriptionBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Scoping scoping) protected
BindingImpl
(Object source, Key<T> key, Scoping scoping) private
BindingSelection
(TypeLiteral<K> keyType, TypeLiteral<V> valueType, Key<Map<K, V>> mapKey, RealMultibinder<Map.Entry<K, Provider<V>>> entrySetBinder) (package private)
BindingSelection
(Key<T> key) (package private)
BindingSelection
(Key<T> key) (package private)
BoundProviderFactory
(InjectorImpl injector, Key<? extends javax.inject.Provider<? extends T>> providerKey, Object source, ProvisionListenerStackCallback<T> provisionCallback) private
ConstructorBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> scopedFactory, Scoping scoping, ConstructorBindingImpl.Factory<T> factory, InjectionPoint constructorInjectionPoint) ConstructorBindingImpl
(Key<T> key, Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, Set<InjectionPoint> injectionPoints) (package private)
ConvertedConstantBindingImpl
(InjectorImpl injector, Key<T> key, T value, Binding<String> originalBinding, TypeConverterBinding typeConverterBinding) ExposedBindingImpl
(InjectorImpl injector, Object source, Key<T> key, InternalFactory<T> factory, PrivateElements privateElements) (package private)
ExposedKeyFactory
(Key<T> key, PrivateElements privateElements) ExposureBuilder
(Binder binder, Object source, Key<T> key) (package private)
(package private)
FactoryProxy
(InjectorImpl injector, Key<T> key, Key<? extends T> targetKey, Object source) InjectableReference
(InjectorImpl injector, T instance, Key<T> key, ProvisionListenerStackCallback<T> provisionCallback, Object source, CycleDetectingLock<?> lock) InstanceBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Set<InjectionPoint> injectionPoints, T instance) InstanceBindingImpl
(Object source, Key<T> key, Scoping scoping, Set<InjectionPoint> injectionPoints, T instance) (package private)
InternalProviderInstanceBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalProviderInstanceBindingImpl.Factory<T> originalFactory, InternalFactory<? extends T> scopedFactory, Scoping scoping) (package private)
JavaOptionalProvider
(RealOptionalBinder.BindingSelection<T> bindingSelection, Key<Optional<T>> optionalKey) (package private)
KeyAndSource
(Key<?> key, Object source) (package private)
KeyBinding
(Key<?> key, Binding<?> binding) LinkedBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Scoping scoping, Key<? extends T> targetKey) LinkedProviderBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Scoping scoping, Key<? extends javax.inject.Provider<? extends T>> providerKey) private
LinkedProviderBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Scoping scoping, Key<? extends javax.inject.Provider<? extends T>> providerKey, DelayedInitialize delayedInitializer) (package private)
LinkedProviderBindingImpl
(Object source, Key<T> key, Scoping scoping, Key<? extends javax.inject.Provider<? extends T>> providerKey) (package private)
PermitDuplicatesModule
(Key<Boolean> key) (package private)
ProvidedByInternalFactory
(Class<?> rawType, Class<? extends javax.inject.Provider<?>> providerType, Key<? extends javax.inject.Provider<T>> providerKey) ProviderInstanceBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Scoping scoping, javax.inject.Provider<? extends T> providerInstance, Set<InjectionPoint> injectionPoints) ProviderInstanceBindingImpl
(Object source, Key<T> key, Scoping scoping, Set<InjectionPoint> injectionPoints, javax.inject.Provider<? extends T> providerInstance) (package private)
ProviderMapEntry
(K key, Key<V> valueKey) private
ProviderMethod
(Key<T> key, Method method, Object instance, com.google.common.collect.ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, Annotation annotation) private
RealMapBinder
(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Key<Map<K, V>> mapKey, RealMultibinder<Map.Entry<K, Provider<V>>> entrySetBinder) (package private)
RealMultibinder
(Binder binder, Key<T> key) private
RealMultimapBinderProviderWithDependencies
(Key<Map<K, V>> mapKey) private
RealMultimapProvider
(Key<Map<K, V>> mapKey) private
RealOptionalBinder
(Binder binder, Key<T> typeKey) (package private)
RealOptionalKeyProvider
(RealOptionalBinder.BindingSelection<T> bindingSelection, Key<com.google.common.base.Optional<T>> optionalKey) private
RealProviderMultimapProvider
(Key<Map<K, V>> mapKey) (package private)
ReflectionProviderMethod
(Key<T> key, Method method, Object instance, com.google.common.collect.ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, Annotation annotation) (package private)
SyntheticProviderBindingImpl
(InjectorImpl injector, Key<Provider<T>> key, Binding<T> providedBinding) (package private)
UntargettedBindingImpl
(InjectorImpl injector, Key<T> key, Object source) UntargettedBindingImpl
(Object source, Key<T> key, Scoping scoping) -
Uses of Key in com.google.inject.multibindings
Methods in com.google.inject.multibindings that return KeyModifier and TypeMethodDescriptionOptionalBinderBinding.getKey()
Returns theKey
for this binding.MapBinderBinding.getMapKey()
Returns theKey
for the map.MultibinderBinding.getSetKey()
Returns the key for the set.Methods in com.google.inject.multibindings that return types with arguments of type KeyModifier and TypeMethodDescriptionOptionalBinderBinding.getAlternateKeys()
Returns the keys of other bindings that represent this OptionalBinder.MapBinderBinding.getAlternateMapKeys()
Returns the keys of other bindings that represent this map.MultibinderBinding.getAlternateSetKeys()
Returns the keys of other bindings that represent this set.Methods in com.google.inject.multibindings with parameters of type KeyModifier and TypeMethodDescriptionstatic <T> OptionalBinder<T>
OptionalBinder.newOptionalBinder
(Binder binder, Key<T> type) static <T> Multibinder<T>
Multibinder.newSetBinder
(Binder binder, Key<T> key) Returns a new multibinder that collects instances of the key's type in aSet
that is itself bound with the annotation (if any) of the key. -
Uses of Key in com.google.inject.servlet
Fields in com.google.inject.servlet declared as KeyModifier and TypeFieldDescriptionprivate final Key<? extends javax.servlet.Filter>
FilterDefinition.filterKey
private final Key<? extends javax.servlet.http.HttpServlet>
ServletDefinition.servletKey
Fields in com.google.inject.servlet with type parameters of type KeyMethods in com.google.inject.servlet that return KeyModifier and TypeMethodDescriptionKey<? extends javax.servlet.Filter>
LinkedFilterBinding.getLinkedKey()
Returns the key used to lookup the filter instance.Key<? extends javax.servlet.Filter>
LinkedFilterBindingImpl.getLinkedKey()
Key<? extends javax.servlet.http.HttpServlet>
LinkedServletBinding.getLinkedKey()
Returns the key used to lookup the servlet instance.Key<? extends javax.servlet.http.HttpServlet>
LinkedServletBindingImpl.getLinkedKey()
Methods in com.google.inject.servlet with parameters of type KeyModifier and TypeMethodDescriptionprivate static GuiceFilter.Context
GuiceFilter.getContext
(Key<?> key) (package private) static javax.servlet.http.HttpServletRequest
GuiceFilter.getOriginalRequest
(Key<?> key) (package private) static javax.servlet.http.HttpServletRequest
GuiceFilter.getRequest
(Key<?> key) (package private) static javax.servlet.http.HttpServletResponse
GuiceFilter.getResponse
(Key<?> key) <T> Provider<T>
<T> Provider<T>
void
FiltersModuleBuilder.FilterKeyBindingBuilderImpl.through
(Key<? extends javax.servlet.Filter> filterKey) void
FiltersModuleBuilder.FilterKeyBindingBuilderImpl.through
(Key<? extends javax.servlet.Filter> filterKey, Map<String, String> initParams) private void
FiltersModuleBuilder.FilterKeyBindingBuilderImpl.through
(Key<? extends javax.servlet.Filter> filterKey, Map<String, String> initParams, javax.servlet.Filter filterInstance) void
void
ServletModule.FilterKeyBindingBuilder.through
(Key<? extends javax.servlet.Filter> filterKey, Map<String, String> initParams) private static Object
ServletScopes.validateAndCanonicalizeValue
(Key<?> key, Object object) Validates the key and object, ensuring the value matches the key type, and canonicalizing null objects to the null sentinel.void
ServletModule.ServletKeyBindingBuilder.with
(Key<? extends javax.servlet.http.HttpServlet> servletKey) void
ServletModule.ServletKeyBindingBuilder.with
(Key<? extends javax.servlet.http.HttpServlet> servletKey, Map<String, String> initParams) void
ServletsModuleBuilder.ServletKeyBindingBuilderImpl.with
(Key<? extends javax.servlet.http.HttpServlet> servletKey) void
ServletsModuleBuilder.ServletKeyBindingBuilderImpl.with
(Key<? extends javax.servlet.http.HttpServlet> servletKey, Map<String, String> initParams) private void
ServletsModuleBuilder.ServletKeyBindingBuilderImpl.with
(Key<? extends javax.servlet.http.HttpServlet> servletKey, Map<String, String> initParams, javax.servlet.http.HttpServlet servletInstance) Method parameters in com.google.inject.servlet with type arguments of type KeyModifier and TypeMethodDescriptionstatic <T> Callable<T>
ServletScopes.continueRequest
(Callable<T> callable, Map<Key<?>, Object> seedMap) Deprecated.private static RequestScoper
ServletScopes.continueRequest
(Map<Key<?>, Object> seedMap) static <T> Callable<T>
ServletScopes.scopeRequest
(Callable<T> callable, Map<Key<?>, Object> seedMap) Scopes the given callable inside a request scope.static RequestScoper
ServletScopes.scopeRequest
(Map<Key<?>, Object> seedMap) Returns an object that will apply request scope to a block of code.Constructors in com.google.inject.servlet with parameters of type KeyModifierConstructorDescriptionFilterDefinition
(Key<? extends javax.servlet.Filter> filterKey, UriPatternMatcher patternMatcher, Map<String, String> initParams, javax.servlet.Filter filterInstance) (package private)
LinkedFilterBindingImpl
(Map<String, String> initParams, Key<? extends javax.servlet.Filter> target, UriPatternMatcher patternMatcher) (package private)
LinkedServletBindingImpl
(Map<String, String> initParams, Key<? extends javax.servlet.http.HttpServlet> target, UriPatternMatcher patternMatcher) ServletDefinition
(Key<? extends javax.servlet.http.HttpServlet> servletKey, UriPatternMatcher patternMatcher, Map<String, String> initParams, javax.servlet.http.HttpServlet servletInstance) -
Uses of Key in com.google.inject.spi
Fields in com.google.inject.spi declared as KeyMethods in com.google.inject.spi that return KeyModifier and TypeMethodDescriptionDependency.getKey()
Returns the key to the binding that satisfies this dependency.ProviderLookup.getKey()
ProvidesMethodBinding.getKey()
Returns the key of the binding.LinkedKeyBinding.getLinkedKey()
Returns the linked key used to resolve injections.Key<?>
ProviderBinding.getProvidedKey()
Returns the key whose binding is used toprovide instances
.ProviderKeyBinding.getProviderKey()
Returns the key used to resolve the provider's binding.ConvertedConstantBinding.getSourceKey()
Returns the key for the source binding.abstract <T> Key<T>
ModuleAnnotatedMethodScanner.prepareMethod
(Binder binder, Annotation annotation, Key<T> key, InjectionPoint injectionPoint) Prepares a method for binding.Methods in com.google.inject.spi that return types with arguments of type KeyModifier and TypeMethodDescriptionPrivateElements.getExposedKeys()
Returns the unique exposed keys for these private elements.Methods in com.google.inject.spi with parameters of type KeyModifier and TypeMethodDescription<T> AnnotatedBindingBuilder<T>
void
private <T> AnnotatedElementBuilder
Elements.RecordingBinder.exposeInternal
(Key<T> key) static <T> Dependency<T>
Returns a new dependency that is not attached to an injection point.PrivateElements.getExposedSource
(Key<?> key) Returns an arbitrary object containing information about the "place" where this key was exposed.<T> Provider<T>
Elements.RecordingBinder.getProvider
(Key<T> key) <T> Provider<T>
TypeEncounter.getProvider
(Key<T> key) Returns the provider used to obtain instances for the given injection key.private <T> Dependency<T>
InjectionPoint.newDependency
(Key<T> key, boolean allowsNull, int parameterIndex) abstract <T> Key<T>
ModuleAnnotatedMethodScanner.prepareMethod
(Binder binder, Annotation annotation, Key<T> key, InjectionPoint injectionPoint) Prepares a method for binding.Constructors in com.google.inject.spi with parameters of type KeyModifierConstructorDescription(package private)
Dependency
(InjectionPoint injectionPoint, Key<T> key, boolean nullable, int parameterIndex) ProviderLookup
(Object source, Key<T> key) -
Uses of Key in com.google.inject.throwingproviders
Fields in com.google.inject.throwingproviders declared as KeyModifier and TypeFieldDescriptionThrowingProviderBinder.SecondaryBinder.interfaceKey
CheckedProviderMethod.key
CheckedProviderMethodsModule.LOGGER_KEY
Methods in com.google.inject.throwingproviders that return KeyModifier and TypeMethodDescriptionThrowingProviderBinder.SecondaryBinder.createKey()
(package private) <T> Key<T>
CheckedProviderMethodsModule.getKey
(Errors errors, TypeLiteral<T> type, Member member, Annotation[] annotations) ThrowingProviderBinder.SecondaryBinder.getKey()
Methods in com.google.inject.throwingproviders with parameters of type KeyModifier and TypeMethodDescriptionThrowingProviderBinder.SecondaryBinder.createResultProvider
(Key<? extends CheckedProvider<?>> targetKey, Provider<? extends CheckedProvider<?>> targetProvider) private ScopedBindingBuilder
ThrowingProviderBinder.SecondaryBinder.toInternal
(Key<? extends CheckedProvider<?>> targetKey) Constructors in com.google.inject.throwingproviders with parameters of type KeyModifierConstructorDescription(package private)
CheckedProviderMethod
(Key<T> key, Method method, Object instance, com.google.common.collect.ImmutableSet<Dependency<?>> dependencies, List<Provider<?>> parameterProviders, Class<? extends Annotation> scopeAnnotation, Class<? extends CheckedProvider> checkedProvider, List<TypeLiteral<?>> exceptionTypes, boolean scopeExceptions)
transferRequest
instead