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>voidMakes the binding forkeyavailable to the enclosing environmentprotected final <T> voidMakes the binding forkeyavailable 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> TInjector.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 voidAbstractModule.requireBinding(Key<?> key) Adds a dependency from this module tokey.protected final voidPrivateModule.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.factoryKeyThe key that this is bound to.(package private) final Key<?>FactoryProvider2.AssistData.returnTypethe 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.paramTypesthe 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 theKeyfor 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> Moduleprivate <T> InjectionPointFactoryProvider2.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 booleanMethod parameters in com.google.inject.assistedinject with type arguments of type KeyModifier and TypeMethodDescriptionprivate booleanFactoryProvider2.constructorHasMatchingParams(TypeLiteral<?> type, Constructor<?> constructor, List<Key<?>> paramList, Errors errors) Matching logic for constructors annotated with AssistedInject.private <T> InjectionPointFactoryProvider2.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.keyDefaultRootKeySetCreator.loggerKeyMethods 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 NodeIdNodeId.newInstanceId(Key<?> key) static NodeIdMethod 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 voidvoidGraphs 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.actualBindingKeylazily allocated, byRealOptionalBinder.BindingSelection.getKeyForActualBinding().private Key<Collection<javax.inject.Provider<T>>>RealMultibinder.BindingSelection.collectionOfJavaxProvidersKeyprivate Key<Collection<Provider<T>>>RealMultibinder.BindingSelection.collectionOfProvidersKeyRealOptionalBinder.BindingSelection.defaultBindingKeylazily allocated, byRealOptionalBinder.BindingSelection.getKeyForDefaultBinding().RealMapBinder.BindingSelection.entrySetJavaxProviderKeyprivate Key<Map<K,Collection<javax.inject.Provider<V>>>> RealMapBinder.BindingSelection.javaxProviderCollectionMultimapKeyRealMapBinder.BindingSelection.javaxProviderMapKeyRealMapBinder.BindingSelection.javaxProviderSetMultimapKeyAbstractBindingProcessor.Processor.keyBindingImpl.keyprivate final Key<?>ConstructorBindingImpl.Factory.keyExposedKeyFactory.keyExposureBuilder.keyFactoryProxy.keyInitializer.InjectableReference.keyProviderMethod.key(package private) final Key<?>ProvisionListenerCallbackStore.KeyBinding.keyRealMultibinder.PermitDuplicatesModule.keyRealOptionalBinder.BindingSelection.key(package private) final Key<?>WeakKeySet.KeyAndSource.keyRealMapBinder.BindingSelection.mapKeyRealMapBinder.RealMultimapBinderProviderWithDependencies.mapKeyRealMapBinder.BindingSelection.multimapKeyprotected static final Key<?>AbstractBindingBuilder.NULL_KEYRealOptionalBinder.JavaOptionalProvider.optionalKeyRealOptionalBinder.RealOptionalKeyProvider.optionalKeyRealMultibinder.BindingSelection.permitDuplicatesKeyRealMapBinder.BindingSelection.providerCollectionMultimapKeyBoundProviderFactory.providerKeyLinkedProviderBindingImpl.providerKeyProvidedByInternalFactory.providerKeyRealMapBinder.BindingSelection.providerMapKeyRealMapBinder.BindingSelection.providerSetMultimapKeyRealMultibinder.BindingSelection.setKeyFactoryProxy.targetKeyLinkedBindingImpl.targetKeyRealOptionalBinder.RealDirectTypeProvider.targetKeyRealMapBinder.ProviderMapEntry.valueKeyFields in com.google.inject.internal with type parameters of type KeyModifier and TypeFieldDescriptionWeakKeySet.backingMapprivate static final CycleDetectingLock.CycleDetectingLockFactory<Key<?>>SingletonScope.cycleDetectingLockFactoryAllows us to detect when circular proxies are necessary.InheritingState.explicitBindingsInheritingState.explicitBindingsMutablePrivateElementsImpl.exposedKeysToSourceslazily instantiatedInjectorImpl.failedJitBindingsCache 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.jitBindingsJust-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 TypeMethodDescriptionvoidprivate <T> voidBindingProcessor.bindExposed(PrivateElements privateElements, Key<T> key) Errors.bindingAlreadySet(Key<?> key, Object source) voidvoidForbids 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) booleanprivate <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 forkeyin 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> TInjectorImpl.getInstance(Key<T> key) <T> TInternalInjectorCreator.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) voidMembersInjectorImpl.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) booleanInheritingState.isBlacklisted(Key<?> key) booleanState.isBlacklisted(Key<?> key) Returns true ifkeyis forbidden from being bound in this injector.private static booleanInjectorImpl.isMembersInjector(Key<?> key) Returns true if the key type is MembersInjector (but not a subclass of MembersInjector).private static booleanInjectorImpl.isProvider(Key<?> key) Returns true if the key type is Provider (but not a subclass of Provider).private static booleanInjectorImpl.isTypeLiteral(Key<?> key) Errors.jitBindingAlreadySet(Key<?> key) Errors.jitDisabled(Key<?> key) static InternalProvisionExceptionInternalProvisionException.jitDisabled(Key<?> key) Errors.jitDisabledInParent(Key<?> key) private booleanRealMultibinder.BindingSelection.keyMatches(Key<?> key) private booleanRealMapBinder.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> ErrorsErrors.missingImplementationWithHint(Key<T> key, Injector injector) Within guice's core, allow for better missing binding messagesstatic StringReturns 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) voidAdds to the state without setting the dependency.voidInheritingState.putBinding(Key<?> key, BindingImpl<?> binding) voidState.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> voidAbstractBindingProcessor.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 booleanInjectorImpl.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) protectedBindingImpl(Object source, Key<T> key, Scoping scoping) privateBindingSelection(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) privateConstructorBindingImpl(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) privateLinkedProviderBindingImpl(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) privateProviderMethod(Key<T> key, Method method, Object instance, com.google.common.collect.ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, Annotation annotation) privateRealMapBinder(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) privateRealMultimapBinderProviderWithDependencies(Key<Map<K, V>> mapKey) privateRealMultimapProvider(Key<Map<K, V>> mapKey) privateRealOptionalBinder(Binder binder, Key<T> typeKey) (package private)RealOptionalKeyProvider(RealOptionalBinder.BindingSelection<T> bindingSelection, Key<com.google.common.base.Optional<T>> optionalKey) privateRealProviderMultimapProvider(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 theKeyfor this binding.MapBinderBinding.getMapKey()Returns theKeyfor 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 aSetthat 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.filterKeyprivate final Key<? extends javax.servlet.http.HttpServlet>ServletDefinition.servletKeyFields 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.ContextGuiceFilter.getContext(Key<?> key) (package private) static javax.servlet.http.HttpServletRequestGuiceFilter.getOriginalRequest(Key<?> key) (package private) static javax.servlet.http.HttpServletRequestGuiceFilter.getRequest(Key<?> key) (package private) static javax.servlet.http.HttpServletResponseGuiceFilter.getResponse(Key<?> key) <T> Provider<T><T> Provider<T>voidFiltersModuleBuilder.FilterKeyBindingBuilderImpl.through(Key<? extends javax.servlet.Filter> filterKey) voidFiltersModuleBuilder.FilterKeyBindingBuilderImpl.through(Key<? extends javax.servlet.Filter> filterKey, Map<String, String> initParams) private voidFiltersModuleBuilder.FilterKeyBindingBuilderImpl.through(Key<? extends javax.servlet.Filter> filterKey, Map<String, String> initParams, javax.servlet.Filter filterInstance) voidvoidServletModule.FilterKeyBindingBuilder.through(Key<? extends javax.servlet.Filter> filterKey, Map<String, String> initParams) private static ObjectServletScopes.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.voidServletModule.ServletKeyBindingBuilder.with(Key<? extends javax.servlet.http.HttpServlet> servletKey) voidServletModule.ServletKeyBindingBuilder.with(Key<? extends javax.servlet.http.HttpServlet> servletKey, Map<String, String> initParams) voidServletsModuleBuilder.ServletKeyBindingBuilderImpl.with(Key<? extends javax.servlet.http.HttpServlet> servletKey) voidServletsModuleBuilder.ServletKeyBindingBuilderImpl.with(Key<? extends javax.servlet.http.HttpServlet> servletKey, Map<String, String> initParams) private voidServletsModuleBuilder.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 RequestScoperServletScopes.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 RequestScoperServletScopes.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>voidprivate <T> AnnotatedElementBuilderElements.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.interfaceKeyCheckedProviderMethod.keyCheckedProviderMethodsModule.LOGGER_KEYMethods 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 ScopedBindingBuilderThrowingProviderBinder.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)
transferRequestinstead