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.internal |
Guice (sounds like like "juice")
|
com.google.inject.multibindings |
Extension for binding multiple instances in a collection; this extension requires
guice-multibindings.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 |
---|---|
<T> Provider<T> |
Binder.getProvider(Dependency<T> dependency)
Returns the provider used to obtain instances for the given injection key.
|
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Set<Dependency<?>> |
FactoryProvider2.AssistData.dependencies
All non-assisted dependencies required by this method.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<Dependency<?>> |
FactoryProvider.getDependencies()
Deprecated.
|
java.util.Set<Dependency<?>> |
AssistedMethod.getDependencies()
Returns all non-assisted dependencies required to construct and inject
the implementation.
|
java.util.Set<Dependency<?>> |
FactoryProvider2.getDependencies() |
java.util.Set<Dependency<?>> |
FactoryProvider2.AssistData.getDependencies() |
private java.util.Set<Dependency<?>> |
FactoryProvider2.getDependencies(InjectionPoint ctorPoint,
TypeLiteral<?> implementation)
Calculates all dependencies required by the implementation and constructor.
|
private java.util.Set<Dependency<?>> |
FactoryProvider2.removeAssistedDeps(java.util.Set<Dependency<?>> deps)
Return all non-assisted dependencies.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
FactoryProvider2.isInjectorOrAssistedProvider(Dependency<?> dependency)
|
Modifier and Type | Method and Description |
---|---|
private boolean |
FactoryProvider2.isValidForOptimizedAssistedInject(java.util.Set<Dependency<?>> dependencies,
java.lang.Class<?> implementation,
TypeLiteral<?> factoryType)
Returns true if all dependencies are suitable for the optimized version of AssistedInject.
|
private java.util.Set<Dependency<?>> |
FactoryProvider2.removeAssistedDeps(java.util.Set<Dependency<?>> deps)
Return all non-assisted dependencies.
|
Constructor and Description |
---|
AssistData(java.lang.reflect.Constructor<?> constructor,
Key<?> returnType,
com.google.common.collect.ImmutableList<Key<?>> paramTypes,
TypeLiteral<?> implementationType,
java.lang.reflect.Method factoryMethod,
java.util.Set<Dependency<?>> dependencies,
boolean optimized,
java.util.List<FactoryProvider2.ThreadLocalProvider> providers) |
Modifier and Type | Field and Description |
---|---|
(package private) Dependency<?> |
SingleFieldInjector.dependency |
private Dependency<T> |
SingleParameterInjector.dependency |
private Dependency<?> |
InternalContext.dependency
Keeps track of the type that is currently being requested for injection.
|
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableSet<Dependency<?>> |
ProviderMethod.dependencies |
private static java.util.Set<Dependency<?>> |
Errors.warnedDependencies |
Modifier and Type | Method and Description |
---|---|
Dependency<?> |
InternalContext.getDependency() |
Dependency<?> |
InternalContext.pushDependency(Dependency<?> dependency,
java.lang.Object source)
Sets the new current dependency & adds it to the state.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<Dependency<?>> |
InjectorImpl.ProviderBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
InjectorImpl.ConvertedConstantBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
ExposedBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
ProviderMethod.getDependencies() |
java.util.Set<Dependency<?>> |
ConstructorBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
InstanceBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
LinkedProviderBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
ProviderInstanceBindingImpl.getDependencies() |
java.util.Set<Dependency<?>> |
LinkedBindingImpl.getDependencies() |
(package private) java.util.Set<Dependency<?>> |
ConstructorBindingImpl.getInternalDependencies()
Returns a set of dependencies that can be iterated over to clean up stray JIT bindings.
|
private java.util.Set<Dependency<?>> |
InjectorImpl.getInternalDependencies(BindingImpl<?> binding)
Safely gets the dependencies of possibly not initialized bindings.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
Errors.checkForNull(T value,
java.lang.Object source,
Dependency<?> dependency)
Returns
value if it is non-null or allowed to be null. |
protected T |
ProviderInternalFactory.circularGet(javax.inject.Provider<? extends T> provider,
Errors errors,
InternalContext context,
Dependency<?> dependency,
ProvisionListenerStackCallback<T> provisionCallback) |
(package private) <T> SingleParameterInjector<T> |
InjectorImpl.createParameterInjector(Dependency<T> dependency,
Errors errors) |
static void |
Errors.formatInjectionPoint(java.util.Formatter formatter,
Dependency<?> dependency,
InjectionPoint injectionPoint,
ElementSource elementSource) |
private static java.lang.String |
Errors.formatParameter(Dependency<?> dependency) |
T |
ProviderMethod.Factory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
ConstructorBindingImpl.Factory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
InternalFactory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked)
Creates an object to be injected.
|
T |
InternalFactoryToInitializableAdapter.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
FactoryProxy.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
BoundProviderFactory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
InternalFactoryToProviderAdapter.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
ExposedKeyFactory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
Injector |
InjectorShell.InjectorFactory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
java.util.logging.Logger |
InjectorShell.LoggerFactory.get(Errors errors,
InternalContext context,
Dependency<?> dependency,
boolean linked) |
T |
ConstantFactory.get(Errors errors,
InternalContext context,
Dependency dependency,
boolean linked) |
T |
ProvidedByInternalFactory.get(Errors errors,
InternalContext context,
Dependency dependency,
boolean linked) |
(package private) <T> Provider<T> |
InjectorImpl.getProviderOrThrow(Dependency<T> dependency,
Errors errors) |
void |
InternalContext.popStateAndSetDependency(Dependency<?> newDependency)
Pops the current state & sets the new dependency.
|
(package private) T |
ProviderMethod.Factory.provision(Errors errors,
Dependency<?> dependency,
InternalContext context,
ConstructionContext<T> constructionContext) |
protected T |
InternalFactoryToInitializableAdapter.provision(javax.inject.Provider<? extends T> provider,
Errors errors,
Dependency<?> dependency,
ConstructionContext<T> constructionContext) |
protected T |
BoundProviderFactory.provision(javax.inject.Provider<? extends T> provider,
Errors errors,
Dependency<?> dependency,
ConstructionContext<T> constructionContext) |
protected T |
ProvidedByInternalFactory.provision(javax.inject.Provider<? extends T> provider,
Errors errors,
Dependency<?> dependency,
ConstructionContext<T> constructionContext) |
protected T |
ProviderInternalFactory.provision(javax.inject.Provider<? extends T> provider,
Errors errors,
Dependency<?> dependency,
ConstructionContext<T> constructionContext)
Provisions a new instance.
|
Dependency<?> |
InternalContext.pushDependency(Dependency<?> dependency,
java.lang.Object source)
Sets the new current dependency & adds it to the state.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <T> ProviderMethod<T> |
ProviderMethod.create(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,
boolean skipFastClassGeneration,
java.lang.annotation.Annotation annotation)
Creates a
ProviderMethod . |
(package private) SingleParameterInjector<?>[] |
InjectorImpl.getParametersInjectors(java.util.List<Dependency<?>> parameters,
Errors errors)
Returns parameter injectors, or
null if there are no parameters. |
Constructor and Description |
---|
SingleParameterInjector(Dependency<T> dependency,
BindingImpl<? extends T> binding) |
Constructor and Description |
---|
FastClassProviderMethod(Key<T> key,
net.sf.cglib.reflect.FastClass fc,
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.annotation.Annotation annotation) |
ProviderMethod(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.annotation.Annotation annotation) |
ReflectionProviderMethod(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.annotation.Annotation annotation) |
Modifier and Type | Field and Description |
---|---|
private java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.dependencies
the dependencies -- initialized with defaults & overridden when tooled.
|
private com.google.common.collect.ImmutableSet<Dependency<?>> |
MapBinder.RealMapBinder.RealProviderMapProvider.dependencies |
private com.google.common.collect.ImmutableSet<Dependency<?>> |
MapBinder.RealMapBinder.RealMapProvider.dependencies |
private com.google.common.collect.ImmutableSet<Dependency<?>> |
MapBinder.RealMapBinder.MultimapBinder.RealProviderMultimapProvider.dependencies |
private com.google.common.collect.ImmutableSet<Dependency<?>> |
MapBinder.RealMapBinder.MultimapBinder.RealMultimapProvider.dependencies |
private java.util.Set<Dependency<?>> |
Multibinder.RealMultibinder.dependencies |
private java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.providerDependencies
the dependencies -- initialized with defaults & overridden when tooled.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.JavaOptionalProvider.getDependencies() |
java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.JavaOptionalProviderProvider.getDependencies() |
java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.RealDirectTypeProvider.getDependencies() |
java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.RealOptionalProviderProvider.getDependencies() |
java.util.Set<Dependency<?>> |
OptionalBinder.RealOptionalBinder.RealOptionalKeyProvider.getDependencies() |
java.util.Set<Dependency<?>> |
MapBinder.RealMapBinder.RealProviderMapProvider.getDependencies() |
java.util.Set<Dependency<?>> |
MapBinder.RealMapBinder.RealMapProvider.getDependencies() |
java.util.Set<Dependency<?>> |
MapBinder.RealMapBinder.MultimapBinder.RealProviderMultimapProvider.getDependencies() |
java.util.Set<Dependency<?>> |
MapBinder.RealMapBinder.MultimapBinder.RealMultimapProvider.getDependencies() |
java.util.Set<Dependency<?>> |
MapBinder.RealMapBinder.ProviderMapEntry.getDependencies() |
java.util.Set<Dependency<?>> |
Multibinder.RealMultibinder.getDependencies() |
java.util.Set<Dependency<?>> |
Multibinder.RealMultibinder.RealMultibinderCollectionOfProvidersProvider.getDependencies() |
Constructor and Description |
---|
RealMapProvider(com.google.common.collect.ImmutableSet<Dependency<?>> dependencies,
Provider<java.util.Map<K,Provider<V>>> mapProvider) |
RealMultimapProvider(com.google.common.collect.ImmutableSet<Dependency<?>> dependencies,
Provider<java.util.Map<K,java.util.Set<Provider<V>>>> multimapProvider) |
RealProviderMapProvider(com.google.common.collect.ImmutableSet<Dependency<?>> dependencies,
Provider<java.util.Set<java.util.Map.Entry<K,Provider<V>>>> entrySetProvider) |
RealProviderMultimapProvider(com.google.common.collect.ImmutableSet<Dependency<?>> dependencies,
Provider<java.util.Set<java.util.Map.Entry<K,Provider<V>>>> entrySetProvider) |
Modifier and Type | Field and Description |
---|---|
private Dependency<?> |
DependencyAndSource.dependency |
private Dependency<T> |
ProviderLookup.dependency |
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<Dependency<?>> |
InjectionPoint.dependencies |
Modifier and Type | Method and Description |
---|---|
static <T> Dependency<T> |
Dependency.get(Key<T> key)
Returns a new dependency that is not attached to an injection point.
|
Dependency<?> |
DependencyAndSource.getDependency()
Returns the Dependency, if one exists.
|
Dependency<T> |
ProviderLookup.getDependency() |
private <T> Dependency<T> |
InjectionPoint.newDependency(Key<T> key,
boolean allowsNull,
int parameterIndex) |
Modifier and Type | Method and Description |
---|---|
static java.util.Set<Dependency<?>> |
Dependency.forInjectionPoints(java.util.Set<InjectionPoint> injectionPoints)
Returns the dependencies from the given injection points.
|
private com.google.common.collect.ImmutableList<Dependency<?>> |
InjectionPoint.forMember(java.lang.reflect.Member member,
TypeLiteral<?> type,
java.lang.annotation.Annotation[][] paramterAnnotations) |
java.util.List<Dependency<?>> |
InjectionPoint.getDependencies()
Returns the dependencies for this injection point.
|
java.util.Set<Dependency<?>> |
HasDependencies.getDependencies()
Returns the known dependencies for this type.
|
java.util.Set<Dependency<?>> |
ConvertedConstantBinding.getDependencies()
Returns a singleton set containing only the converted key.
|
Modifier and Type | Method and Description |
---|---|
<T> Provider<T> |
Elements.RecordingBinder.getProvider(Dependency<T> dependency) |
Constructor and Description |
---|
DependencyAndSource(Dependency<?> dependency,
java.lang.Object source) |
ProviderLookup(java.lang.Object source,
Dependency<T> dependency) |
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableSet<Dependency<?>> |
CheckedProviderMethod.dependencies |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Dependency<?>> |
CheckedProviderMethod.getDependencies() |
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 | Field and Description |
---|---|
private java.util.Set<Dependency<?>> |
Providers.GuicifiedProviderWithDependencies.dependencies |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Dependency<?>> |
Providers.GuicifiedProviderWithDependencies.getDependencies() |
Constructor and Description |
---|
GuicifiedProviderWithDependencies(java.util.Set<Dependency<?>> dependencies,
javax.inject.Provider<T> delegate) |