Package | Description |
---|---|
com.google.inject |
Google Guice (pronounced "juice") is an ultra-lightweight dependency
injection framework.
|
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.name |
Support for binding to string-based names.
|
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.testing.fieldbinder | |
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 | Interface and Description |
---|---|
interface |
PrivateBinder
Returns a binder whose configuration information is hidden from its environment by default.
|
Modifier and Type | Field and Description |
---|---|
(package private) Binder |
AbstractModule.binder |
Modifier and Type | Method and Description |
---|---|
protected Binder |
AbstractModule.binder()
Gets direct access to the underlying
Binder . |
Binder |
Binder.skipSources(java.lang.Class... classesToSkip)
Returns a binder that skips
classesToSkip when identify the
calling code. |
Binder |
Binder.withSource(java.lang.Object source)
Returns a binder that uses
source as the reference location for
configuration errors. |
Modifier and Type | Method and Description |
---|---|
void |
PrivateModule.configure(Binder binder) |
void |
Module.configure(Binder binder)
Contributes bindings and other configurations for this module to
binder . |
void |
AbstractModule.configure(Binder builder) |
Modifier and Type | Field and Description |
---|---|
protected Binder |
AbstractBindingBuilder.binder |
private Binder |
ExposureBuilder.binder |
Modifier and Type | Method and Description |
---|---|
void |
UntargettedBindingImpl.applyTo(Binder binder) |
void |
InjectorImpl.ProviderBindingImpl.applyTo(Binder binder) |
void |
InjectorImpl.ConvertedConstantBindingImpl.applyTo(Binder binder) |
void |
ExposedBindingImpl.applyTo(Binder binder) |
void |
ConstructorBindingImpl.applyTo(Binder binder) |
void |
InstanceBindingImpl.applyTo(Binder binder) |
void |
LinkedProviderBindingImpl.applyTo(Binder binder) |
void |
PrivateElementsImpl.applyTo(Binder binder) |
void |
ProviderInstanceBindingImpl.applyTo(Binder binder) |
void |
LinkedBindingImpl.applyTo(Binder binder) |
void |
ProviderMethod.configure(Binder binder) |
void |
ProviderMethodsModule.configure(Binder binder) |
void |
InjectorShell.RootModule.configure(Binder binder) |
void |
InjectorShell.InheritedScannersModule.configure(Binder binder) |
private <T> ProviderMethod<T> |
ProviderMethodsModule.createProviderMethod(Binder binder,
java.lang.reflect.Method method,
java.lang.annotation.Annotation annotation) |
java.util.List<ProviderMethod<?>> |
ProviderMethodsModule.getProviderMethods(Binder binder) |
private com.google.common.base.Optional<java.lang.annotation.Annotation> |
ProviderMethodsModule.isProvider(Binder binder,
java.lang.reflect.Method method)
Returns true if the method is a provider.
|
Constructor and Description |
---|
AbstractBindingBuilder(Binder binder,
java.util.List<Element> elements,
java.lang.Object source,
Key<T> key) |
BindingBuilder(Binder binder,
java.util.List<Element> elements,
java.lang.Object source,
Key<T> key) |
ConstantBindingBuilderImpl(Binder binder,
java.util.List<Element> elements,
java.lang.Object source) |
ExposureBuilder(Binder binder,
java.lang.Object source,
Key<T> key) |
Modifier and Type | Field and Description |
---|---|
private Binder |
OptionalBinder.RealOptionalBinder.binder
the target injector's binder.
|
private Binder |
MapBinder.RealMapBinder.binder |
private Binder |
Multibinder.RealMultibinder.binder |
Modifier and Type | Method and Description |
---|---|
private void |
OptionalBinder.RealOptionalBinder.addDirectTypeBinding(Binder binder)
Adds a binding for T.
|
private void |
OptionalBinder.RealOptionalBinder.bindJava8Optional(Binder binder) |
void |
OptionalBinder.RealOptionalBinder.configure(Binder binder) |
void |
MapBinder.RealMapBinder.configure(Binder binder) |
void |
MapBinder.RealMapBinder.MultimapBinder.configure(Binder binder) |
void |
Multibinder.RealMultibinder.configure(Binder binder) |
private static MultibindingsScanner.AnnotationOrError |
MultibindingsScanner.findMapKeyAnnotation(Binder binder,
java.lang.reflect.Method method) |
private void |
MapBinder.RealMapBinder.MultimapBinder.linkKeys(Binder binder) |
static <K,V> MapBinder<K,V> |
MapBinder.newMapBinder(Binder binder,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Returns a new mapbinder that collects entries of
keyType /valueType in a
Map that is itself bound with no binding annotation. |
static <K,V> MapBinder<K,V> |
MapBinder.newMapBinder(Binder binder,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType,
java.lang.annotation.Annotation annotation)
Returns a new mapbinder that collects entries of
keyType /valueType in a
Map that is itself bound with annotation . |
static <K,V> MapBinder<K,V> |
MapBinder.newMapBinder(Binder binder,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a new mapbinder that collects entries of
keyType /valueType in a
Map that is itself bound with annotationType . |
static <K,V> MapBinder<K,V> |
MapBinder.newMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType)
Returns a new mapbinder that collects entries of
keyType /valueType in a
Map that is itself bound with no binding annotation. |
static <K,V> MapBinder<K,V> |
MapBinder.newMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
java.lang.annotation.Annotation annotation)
Returns a new mapbinder that collects entries of
keyType /valueType in a
Map that is itself bound with annotation . |
static <K,V> MapBinder<K,V> |
MapBinder.newMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a new mapbinder that collects entries of
keyType /valueType in a
Map that is itself bound with annotationType . |
static <T> OptionalBinder<T> |
OptionalBinder.newOptionalBinder(Binder binder,
java.lang.Class<T> type) |
static <T> OptionalBinder<T> |
OptionalBinder.newOptionalBinder(Binder binder,
Key<T> type) |
static <T> OptionalBinder<T> |
OptionalBinder.newOptionalBinder(Binder binder,
TypeLiteral<T> type) |
(package private) static <K,V> MapBinder.RealMapBinder<K,V> |
MapBinder.newRealMapBinder(Binder binder,
TypeLiteral<K> keyType,
Key<V> valueTypeAndAnnotation) |
private static <K,V> MapBinder.RealMapBinder<K,V> |
MapBinder.newRealMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
Key<java.util.Map<K,V>> mapKey,
Multibinder<java.util.Map.Entry<K,Provider<V>>> entrySetBinder) |
(package private) static <T> OptionalBinder.RealOptionalBinder<T> |
OptionalBinder.newRealOptionalBinder(Binder binder,
Key<T> type) |
(package private) static <T> Multibinder.RealMultibinder<T> |
Multibinder.newRealSetBinder(Binder binder,
Key<T> key)
Implementation of newSetBinder.
|
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
java.lang.Class<T> type)
Returns a new multibinder that collects instances of
type in a Set that is
itself bound with no binding annotation. |
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
java.lang.Class<T> type,
java.lang.annotation.Annotation annotation)
Returns a new multibinder that collects instances of
type in a Set that is
itself bound with annotation . |
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
java.lang.Class<T> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a new multibinder that collects instances of
type in a Set that is
itself bound with annotationType . |
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
Key<T> key)
Returns a new multibinder that collects instances of the key's type in a
Set that is
itself bound with the annotation (if any) of the key. |
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
TypeLiteral<T> type)
Returns a new multibinder that collects instances of
type in a Set that is
itself bound with no binding annotation. |
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
TypeLiteral<T> type,
java.lang.annotation.Annotation annotation)
Returns a new multibinder that collects instances of
type in a Set that is
itself bound with annotation . |
static <T> Multibinder<T> |
Multibinder.newSetBinder(Binder binder,
TypeLiteral<T> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a new multibinder that collects instances of
type in a Set that is
itself bound with annotationType . |
<T> Key<T> |
MultibindingsScanner.Scanner.prepareMethod(Binder binder,
java.lang.annotation.Annotation annotation,
Key<T> key,
InjectionPoint injectionPoint) |
Constructor and Description |
---|
RealMapBinder(Binder binder,
TypeLiteral<K> keyType,
TypeLiteral<V> valueType,
Key<java.util.Map<K,V>> mapKey,
Multibinder<java.util.Map.Entry<K,Provider<V>>> entrySetBinder) |
RealMultibinder(Binder binder,
TypeLiteral<T> elementType,
Key<java.util.Set<T>> setKey) |
RealOptionalBinder(Binder binder,
Key<T> typeKey) |
Modifier and Type | Method and Description |
---|---|
static void |
Names.bindProperties(Binder binder,
java.util.Map<java.lang.String,java.lang.String> properties)
Creates a constant binding to
@Named(key) for each entry in
properties . |
static void |
Names.bindProperties(Binder binder,
java.util.Properties properties)
Creates a constant binding to
@Named(key) for each property. |
Modifier and Type | Field and Description |
---|---|
private Binder |
ServletsModuleBuilder.binder |
private Binder |
FiltersModuleBuilder.binder |
Constructor and Description |
---|
FiltersModuleBuilder(Binder binder) |
ServletsModuleBuilder(Binder binder) |
Modifier and Type | Class and Description |
---|---|
private static class |
Elements.RecordingBinder |
Modifier and Type | Field and Description |
---|---|
private Binder |
Elements.ModuleInfo.binder |
Modifier and Type | Method and Description |
---|---|
void |
DisableCircularProxiesOption.applyTo(Binder binder) |
void |
InterceptorBinding.applyTo(Binder binder) |
void |
StaticInjectionRequest.applyTo(Binder binder) |
void |
Message.applyTo(Binder binder) |
void |
ProvisionListenerBinding.applyTo(Binder binder) |
void |
InjectionRequest.applyTo(Binder binder) |
void |
ModuleAnnotatedMethodScannerBinding.applyTo(Binder binder) |
void |
Element.applyTo(Binder binder)
Writes this module element to the given binder (optional operation).
|
void |
ExposedBinding.applyTo(Binder binder)
Unsupported.
|
void |
RequireAtInjectOnConstructorsOption.applyTo(Binder binder) |
void |
RequireExplicitBindingsOption.applyTo(Binder binder) |
void |
ProviderLookup.applyTo(Binder binder) |
void |
MembersInjectorLookup.applyTo(Binder binder) |
void |
TypeListenerBinding.applyTo(Binder binder) |
void |
ScopeBinding.applyTo(Binder binder) |
void |
TypeConverterBinding.applyTo(Binder binder) |
void |
RequireExactBindingAnnotationsOption.applyTo(Binder binder) |
void |
Elements.ElementsAsModule.configure(Binder binder) |
abstract <T> Key<T> |
ModuleAnnotatedMethodScanner.prepareMethod(Binder binder,
java.lang.annotation.Annotation annotation,
Key<T> key,
InjectionPoint injectionPoint)
Prepares a method for binding.
|
Constructor and Description |
---|
ModuleInfo(Binder binder,
ModuleSource moduleSource,
boolean skipScanning) |
Modifier and Type | Field and Description |
---|---|
private Binder |
BoundFieldModule.binder |
Modifier and Type | Method and Description |
---|---|
void |
BoundFieldModule.configure(Binder binder) |
Modifier and Type | Field and Description |
---|---|
private Binder |
ThrowingProviderBinder.binder |
Modifier and Type | Method and Description |
---|---|
(package private) void |
CheckedProviderMethod.configure(Binder binder) |
void |
CheckedProviderMethodsModule.configure(Binder binder) |
static ThrowingProviderBinder |
ThrowingProviderBinder.create(Binder binder) |
(package private) <T> CheckedProviderMethod<T> |
CheckedProviderMethodsModule.createProviderMethod(Binder binder,
java.lang.reflect.Method method,
CheckedProvides checkedProvides) |
(package private) static <T> java.lang.reflect.Constructor<? extends T> |
CheckedProvideUtils.findThrowingConstructor(TypeLiteral<? extends T> typeLiteral,
Binder binder) |
(package private) java.util.List<CheckedProviderMethod<?>> |
CheckedProviderMethodsModule.getProviderMethods(Binder binder) |
(package private) static void |
CheckedProvideUtils.validateExceptions(Binder binder,
java.lang.Iterable<TypeLiteral<?>> actualExceptionTypes,
java.lang.Iterable<java.lang.Class<? extends java.lang.Throwable>> expectedExceptionTypes,
java.lang.Class<? extends CheckedProvider> checkedProvider)
Adds errors to the binder if the exceptions aren't valid.
|
Constructor and Description |
---|
ThrowingProviderBinder(Binder binder) |
Modifier and Type | Field and Description |
---|---|
protected Binder |
Modules.ModuleWriter.binder |
Modifier and Type | Method and Description |
---|---|
void |
Modules.EmptyModule.configure(Binder binder) |
void |
Modules.CombinedModule.configure(Binder binder) |
Constructor and Description |
---|
ModuleWriter(Binder binder) |