Class CheckedProviderMethodsModule
- java.lang.Object
-
- com.google.inject.throwingproviders.CheckedProviderMethodsModule
-
- All Implemented Interfaces:
Module
final class CheckedProviderMethodsModule extends java.lang.Object implements Module
Creates bindings to methods annotated with @CheckedProvides
. Use the scope and binding annotations on the provider method to configure the binding.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CheckedProviderMethodsModule.LogProvider
A provider that returns a logger based on the method name.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
delegate
private static Key<java.util.logging.Logger>
LOGGER_KEY
private TypeLiteral<?>
typeLiteral
-
Constructor Summary
Constructors Modifier Constructor Description private
CheckedProviderMethodsModule(java.lang.Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Binder binder)
Contributes bindings and other configurations for this module tobinder
.(package private) <T> CheckedProviderMethod<T>
createProviderMethod(Binder binder, java.lang.reflect.Method method, CheckedProvides checkedProvides)
boolean
equals(java.lang.Object o)
(package private) static Module
forModule(Module module)
Returns a module which creates bindings for provider methods from the given module.(package private) <T> Key<T>
getKey(Errors errors, TypeLiteral<T> type, java.lang.reflect.Member member, java.lang.annotation.Annotation[] annotations)
(package private) java.util.List<CheckedProviderMethod<?>>
getProviderMethods(Binder binder)
int
hashCode()
-
-
-
Field Detail
-
LOGGER_KEY
private static final Key<java.util.logging.Logger> LOGGER_KEY
-
delegate
private final java.lang.Object delegate
-
typeLiteral
private final TypeLiteral<?> typeLiteral
-
-
Method Detail
-
forModule
static Module forModule(Module module)
Returns a module which creates bindings for provider methods from the given module.
-
configure
public void configure(Binder binder)
Description copied from interface:Module
Contributes bindings and other configurations for this module tobinder
.Do not invoke this method directly to install submodules. Instead use
Binder.install(Module)
, which ensures thatprovider methods
are discovered.
-
getProviderMethods
java.util.List<CheckedProviderMethod<?>> getProviderMethods(Binder binder)
-
createProviderMethod
<T> CheckedProviderMethod<T> createProviderMethod(Binder binder, java.lang.reflect.Method method, CheckedProvides checkedProvides)
-
getKey
<T> Key<T> getKey(Errors errors, TypeLiteral<T> type, java.lang.reflect.Member member, java.lang.annotation.Annotation[] annotations)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-