Package | Description |
---|---|
com.google.inject |
Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.
|
com.google.inject.assistedinject |
Extension for combining factory interfaces with injection; this extension requires
guice-assistedinject.jar . |
com.google.inject.binder |
Interfaces which make up
Binder 's expression language. |
com.google.inject.internal |
Guice (sounds like "juice")
|
com.google.inject.jndi |
JNDI integration; this extension requires
guice-jndi.jar . |
com.google.inject.servlet |
Servlet API scopes, bindings and registration; this extension requires
guice-servlet.jar . |
com.google.inject.spi |
Guice service provider interface
|
com.google.inject.throwingproviders |
Extension for injecting objects that may throw at provision time; this extension requires
guice-throwingproviders.jar . |
com.google.inject.util |
Helper methods for working with Guice.
|
Modifier and Type | Method and Description |
---|---|
Provider<T> |
Binding.getProvider()
Returns the scoped provider guice uses to fulfill requests for this binding.
|
<T> Provider<T> |
Injector.getProvider(java.lang.Class<T> type)
Returns the provider used to obtain instances for the given type.
|
<T> Provider<T> |
Binder.getProvider(java.lang.Class<T> type)
Returns the provider used to obtain instances for the given injection type.
|
protected <T> Provider<T> |
AbstractModule.getProvider(java.lang.Class<T> type) |
protected <T> Provider<T> |
PrivateModule.getProvider(java.lang.Class<T> type) |
<T> Provider<T> |
Binder.getProvider(Dependency<T> dependency)
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.
|
<T> Provider<T> |
Binder.getProvider(Key<T> key)
Returns the provider used to obtain instances for the given injection key.
|
protected <T> Provider<T> |
AbstractModule.getProvider(Key<T> key) |
protected <T> Provider<T> |
PrivateModule.getProvider(Key<T> key) |
<T> Provider<T> |
Scope.scope(Key<T> key,
Provider<T> unscoped)
Scopes a provider.
|
Modifier and Type | Method and Description |
---|---|
(package private) Key<Provider<T>> |
Key.providerKey()
Gets the key of this key's provider.
|
(package private) TypeLiteral<Provider<T>> |
TypeLiteral.providerType()
Gets the type of this type's provider.
|
Modifier and Type | Method and Description |
---|---|
<T> Provider<T> |
Scope.scope(Key<T> key,
Provider<T> unscoped)
Scopes a provider.
|
Modifier and Type | Class and Description |
---|---|
(package private) class |
FactoryProvider2<F>
The newer implementation of factory provider.
|
Modifier and Type | Field and Description |
---|---|
private Provider<? extends java.lang.Object> |
Parameter.provider |
Modifier and Type | Method and Description |
---|---|
static <F> Provider<F> |
FactoryProvider.newFactory(java.lang.Class<F> factoryType,
java.lang.Class<?> implementationType)
Deprecated.
|
static <F> Provider<F> |
FactoryProvider.newFactory(TypeLiteral<F> factoryType,
TypeLiteral<?> implementationType)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ScopedBindingBuilder |
LinkedBindingBuilder.toProvider(Provider<? extends T> provider)
See the EDSL examples at
Binder . |
Modifier and Type | Class and Description |
---|---|
class |
ProviderMethod<T>
A provider that invokes a method and returns its result.
|
private static class |
ProviderMethod.FastClassProviderMethod<T>
A
ProviderMethod implementation that uses FastClass.invoke(java.lang.String, java.lang.Class[], java.lang.Object, java.lang.Object[])
to invoke the provider method. |
private static class |
ProviderMethod.ReflectionProviderMethod<T>
A
ProviderMethod implementation that invokes the method using normal java reflection. |
private static class |
RealMapBinder.RealMapProvider<K,V> |
private static class |
RealMultibinder.RealMultibinderProvider<T> |
private static class |
RealOptionalBinder.JavaOptionalProvider
Provides the binding for java.util.Optional
|
private static class |
RealOptionalBinder.RealOptionalKeyProvider<T>
Provides the binding for Optional
|
Modifier and Type | Field and Description |
---|---|
private Provider<T> |
InternalProviderInstanceBindingImpl.Factory.delegateProvider |
private Provider<T> |
BindingImpl.provider |
(package private) Provider<T> |
InjectorImpl.ConvertedConstantBindingImpl.provider |
private Provider<? extends T> |
InternalFactoryToProviderAdapter.provider |
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<Provider<T>> |
RealMultibinder.RealMultibinderCollectionOfProvidersProvider.collectionOfProviders |
private Key<java.util.Collection<Provider<T>>> |
RealMultibinder.BindingSelection.collectionOfProvidersKey |
private java.util.Map.Entry<K,Provider<V>> |
RealMapBinder.ProviderMapEntry.entry |
private RealMultibinder<java.util.Map.Entry<K,Provider<V>>> |
RealMapBinder.entrySetBinder |
private RealMultibinder<java.util.Map.Entry<K,Provider<V>>> |
RealMapBinder.BindingSelection.entrySetBinder |
private java.util.Map<K,Provider<V>> |
RealMapBinder.RealProviderMapProvider.mapOfProviders |
private java.util.Map<K,java.util.Set<Provider<V>>> |
RealMapBinder.MultimapBinder.RealProviderMultimapProvider.multimapOfProviders |
private Key<java.util.Map<K,java.util.Collection<Provider<V>>>> |
RealMapBinder.BindingSelection.providerCollectionMultimapKey |
private Key<java.util.Map<K,Provider<V>>> |
RealMapBinder.BindingSelection.providerMapKey |
private Key<java.util.Map<K,java.util.Set<Provider<V>>>> |
RealMapBinder.BindingSelection.providerSetMultimapKey |
private com.google.common.base.Optional<Provider<T>> |
RealOptionalBinder.RealOptionalProviderProvider.value |
Modifier and Type | Method and Description |
---|---|
Provider<T> |
BindingImpl.getProvider() |
Provider<T> |
InjectorImpl.ConvertedConstantBindingImpl.getProvider() |
<T> Provider<T> |
EncounterImpl.getProvider(java.lang.Class<T> type) |
<T> Provider<T> |
InjectorImpl.getProvider(java.lang.Class<T> type) |
<T> Provider<T> |
InternalInjectorCreator.ToolStageInjector.getProvider(java.lang.Class<T> type) |
<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) |
Provider<? extends T> |
ProviderInstanceBindingImpl.getProviderInstance() |
(package private) <T> Provider<T> |
InjectorImpl.getProviderOrThrow(Dependency<T> dependency,
Errors errors) |
<T> Provider<T> |
SingletonScope.scope(Key<T> key,
Provider<T> creator)
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
initialization
|
Modifier and Type | Method and Description |
---|---|
(package private) static <T> TypeLiteral<java.util.Collection<Provider<T>>> |
RealMultibinder.collectionOfProvidersOf(TypeLiteral<T> elementType) |
(package private) static <T> InternalFactory<Provider<T>> |
InjectorImpl.ProviderBindingImpl.createInternalFactory(Binding<T> providedBinding) |
private <T> BindingImpl<Provider<T>> |
InjectorImpl.createProviderBinding(Key<Provider<T>> key,
Errors errors)
Creates a synthetic binding to
Provider<T> , i.e. |
protected java.util.Collection<Provider<T>> |
RealMultibinder.RealMultibinderCollectionOfProvidersProvider.doProvision(InternalContext context,
Dependency<?> dependency) |
protected java.util.Map<K,Provider<V>> |
RealMapBinder.RealProviderMapProvider.doProvision(InternalContext context,
Dependency<?> dependency) |
protected java.util.Map<K,java.util.Set<Provider<V>>> |
RealMapBinder.MultimapBinder.RealProviderMultimapProvider.doProvision(InternalContext context,
Dependency<?> dependency) |
protected java.util.Map.Entry<K,Provider<V>> |
RealMapBinder.ProviderMapEntry.doProvision(InternalContext context,
Dependency<?> dependency) |
protected com.google.common.base.Optional<Provider<T>> |
RealOptionalBinder.RealOptionalProviderProvider.doProvision(InternalContext context,
Dependency<?> dependency) |
(package private) static <K,V> TypeLiteral<java.util.Map.Entry<K,Provider<V>>> |
RealMapBinder.entryOfJavaxProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) |
(package private) static <K,V> TypeLiteral<java.util.Map.Entry<K,Provider<V>>> |
RealMapBinder.entryOfProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) |
(package private) Key<java.util.Collection<Provider<T>>> |
RealMultibinder.BindingSelection.getCollectionOfProvidersKey() |
private RealMultibinder<java.util.Map.Entry<K,Provider<V>>> |
RealMapBinder.BindingSelection.getEntrySetBinder() |
private static <T> Key<Provider<T>> |
RealMapBinder.getKeyOfProvider(Key<T> valueKey)
Given a Key
|
private Key<java.util.Map<K,java.util.Collection<Provider<V>>>> |
RealMapBinder.BindingSelection.getProviderCollectionMultimapKey() |
private Key<java.util.Map<K,Provider<V>>> |
RealMapBinder.BindingSelection.getProviderMapKey() |
private Key<java.util.Map<K,java.util.Set<Provider<V>>>> |
RealMapBinder.BindingSelection.getProviderSetMultimapKey() |
(package private) static <K,V> TypeLiteral<java.util.Map<K,java.util.Collection<Provider<V>>>> |
RealMapBinder.mapOfCollectionOfProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) |
(package private) static <K,V> TypeLiteral<java.util.Map<K,Provider<V>>> |
RealMapBinder.mapOfProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) |
(package private) static <K,V> TypeLiteral<java.util.Map<K,java.util.Set<Provider<V>>>> |
RealMapBinder.mapOfSetOfProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) |
(package private) static <T> TypeLiteral<com.google.common.base.Optional<Provider<T>>> |
RealOptionalBinder.optionalOfProvider(TypeLiteral<T> type) |
(package private) static <T> Key<Provider<T>> |
RealOptionalBinder.providerOf(Key<T> key) |
Modifier and Type | Method and Description |
---|---|
<T> Provider<T> |
SingletonScope.scope(Key<T> key,
Provider<T> creator)
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
initialization
|
BindingBuilder<T> |
BindingBuilder.toProvider(Provider<? extends T> provider) |
Modifier and Type | Method and Description |
---|---|
<V> V |
InjectorImpl.ProviderBindingImpl.acceptTargetVisitor(BindingTargetVisitor<? super Provider<T>,V> visitor) |
private <T> BindingImpl<Provider<T>> |
InjectorImpl.createProviderBinding(Key<Provider<T>> key,
Errors errors)
Creates a synthetic binding to
Provider<T> , i.e. |
private static <T> Key<T> |
InjectorImpl.getProvidedKey(Key<Provider<T>> key,
Errors errors) |
private static <K,V> RealMapBinder<K,V> |
RealMapBinder.newRealMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
Key<java.util.Map<K,V>> mapKey,
RealMultibinder<java.util.Map.Entry<K,Provider<V>>> entrySetBinder) |
Constructor and Description |
---|
InternalFactoryToProviderAdapter(Provider<? extends T> provider,
java.lang.Object source) |
Constructor and Description |
---|
BindingSelection(TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
Key<java.util.Map<K,V>> mapKey,
RealMultibinder<java.util.Map.Entry<K,Provider<V>>> entrySetBinder) |
ProviderBindingImpl(InjectorImpl injector,
Key<Provider<T>> key,
Binding<T> providedBinding) |
RealMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
Key<java.util.Map<K,V>> mapKey,
RealMultibinder<java.util.Map.Entry<K,Provider<V>>> entrySetBinder) |
Modifier and Type | Method and Description |
---|---|
static <T> Provider<T> |
JndiIntegration.fromJndi(java.lang.Class<T> type,
java.lang.String name)
Creates a provider which looks up objects in JNDI using the given name.
|
Modifier and Type | Class and Description |
---|---|
(package private) class |
FilterDefinition
An internal representation of a filter definition against a particular URI pattern.
|
(package private) class |
ServletDefinition
An internal representation of a servlet definition mapped to a particular URI pattern.
|
Modifier and Type | Field and Description |
---|---|
private Provider<javax.servlet.ServletContext> |
ManagedFilterPipeline.servletContext |
Modifier and Type | Method and Description |
---|---|
<T> Provider<T> |
ServletScopes.RequestScope.scope(Key<T> key,
Provider<T> creator) |
<T> Provider<T> |
ServletScopes.SessionScope.scope(Key<T> key,
Provider<T> creator) |
Modifier and Type | Method and Description |
---|---|
<T> Provider<T> |
ServletScopes.RequestScope.scope(Key<T> key,
Provider<T> creator) |
<T> Provider<T> |
ServletScopes.SessionScope.scope(Key<T> key,
Provider<T> creator) |
Constructor and Description |
---|
ManagedFilterPipeline(Injector injector,
ManagedServletPipeline servletPipeline,
Provider<javax.servlet.ServletContext> servletContext) |
Modifier and Type | Interface and Description |
---|---|
interface |
ProviderBinding<T extends Provider<?>>
A binding to a
Provider that delegates to the binding for the provided type. |
Modifier and Type | Interface and Description |
---|---|
interface |
ProviderWithDependencies<T>
A provider with dependencies on other injected types.
|
interface |
ProviderWithExtensionVisitor<T>
A Provider that is part of an extension which supports a custom BindingTargetVisitor.
|
Modifier and Type | Field and Description |
---|---|
private Provider<T> |
ProviderLookup.delegate |
Modifier and Type | Method and Description |
---|---|
Provider<T> |
ProviderLookup.getDelegate()
Returns the delegate provider, or
null if it has not yet been initialized. |
Provider<T> |
ProviderLookup.getProvider()
Returns the looked up provider.
|
<T> Provider<T> |
TypeEncounter.getProvider(java.lang.Class<T> type)
Returns the provider used to obtain instances for the given injection type.
|
<T> Provider<T> |
Elements.RecordingBinder.getProvider(java.lang.Class<T> type) |
<T> Provider<T> |
Elements.RecordingBinder.getProvider(Dependency<T> dependency) |
<T> Provider<T> |
TypeEncounter.getProvider(Key<T> key)
Returns the provider used to obtain instances for the given injection key.
|
<T> Provider<T> |
Elements.RecordingBinder.getProvider(Key<T> key) |
Provider<? extends T> |
ProviderInstanceBinding.getProviderInstance()
Deprecated.
Use
ProviderInstanceBinding.getUserSuppliedProvider() instead. |
Modifier and Type | Method and Description |
---|---|
void |
ProviderLookup.initializeDelegate(Provider<T> delegate)
Sets the actual provider.
|
Modifier and Type | Field and Description |
---|---|
private java.util.List<Provider<?>> |
CheckedProviderMethod.parameterProviders |
Modifier and Type | Method and Description |
---|---|
private ProviderWithDependencies<ThrowingProviderBinder.Result> |
ThrowingProviderBinder.SecondaryBinder.createResultProvider(Key<? extends CheckedProvider<?>> targetKey,
Provider<? extends CheckedProvider<?>> targetProvider) |
Constructor and Description |
---|
CheckedProviderMethod(Key<T> key,
java.lang.reflect.Method method,
java.lang.Object instance,
com.google.common.collect.ImmutableSet<Dependency<?>> dependencies,
java.util.List<Provider<?>> parameterProviders,
java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation,
java.lang.Class<? extends CheckedProvider> checkedProvider,
java.util.List<TypeLiteral<?>> exceptionTypes,
boolean scopeExceptions) |
Modifier and Type | Class and Description |
---|---|
private static class |
Providers.GuicifiedProviderWithDependencies<T> |
Modifier and Type | Method and Description |
---|---|
static <T> Provider<T> |
Providers.guicify(javax.inject.Provider<T> provider)
Returns a Guice-friendly
com.google.inject.Provider for the given JSR-330 javax.inject.Provider . |
static <T> Provider<T> |
Providers.of(T instance)
Returns a provider which always provides
instance . |