Modifier and Type | Class and Description |
---|---|
private class |
ProviderMethodsModule.Signature |
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
delegate |
private static ModuleAnnotatedMethodScanner |
PROVIDES_BUILDER |
private ModuleAnnotatedMethodScanner |
scanner |
private boolean |
skipFastClassGeneration |
private TypeLiteral<?> |
typeLiteral |
Modifier | Constructor and Description |
---|---|
private |
ProviderMethodsModule(java.lang.Object delegate,
boolean skipFastClassGeneration,
ModuleAnnotatedMethodScanner scanner) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Binder binder)
Contributes bindings and other configurations for this module to
binder . |
private <T> ProviderMethod<T> |
createProviderMethod(Binder binder,
java.lang.reflect.Method method,
java.lang.annotation.Annotation annotation) |
boolean |
equals(java.lang.Object o) |
static Module |
forModule(Module module)
Returns a module which creates bindings for provider methods from the given module.
|
static Module |
forModule(java.lang.Object module,
ModuleAnnotatedMethodScanner scanner)
Returns a module which creates bindings methods in the module that match the scanner.
|
static Module |
forObject(java.lang.Object object)
Returns a module which creates bindings for provider methods from the given object.
|
private static Module |
forObject(java.lang.Object object,
boolean skipFastClassGeneration,
ModuleAnnotatedMethodScanner scanner) |
java.lang.Object |
getDelegateModule() |
(package private) <T> Key<T> |
getKey(Errors errors,
TypeLiteral<T> type,
java.lang.reflect.Member member,
java.lang.annotation.Annotation[] annotations) |
java.util.List<ProviderMethod<?>> |
getProviderMethods(Binder binder) |
int |
hashCode() |
private com.google.common.base.Optional<java.lang.annotation.Annotation> |
isProvider(Binder binder,
java.lang.reflect.Method method)
Returns true if the method is a provider.
|
private static boolean |
overrides(java.lang.reflect.Method a,
java.lang.reflect.Method b)
Returns true if a overrides b, assumes that the signatures match
|
private static ModuleAnnotatedMethodScanner PROVIDES_BUILDER
private final java.lang.Object delegate
private final TypeLiteral<?> typeLiteral
private final boolean skipFastClassGeneration
private final ModuleAnnotatedMethodScanner scanner
private ProviderMethodsModule(java.lang.Object delegate, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)
public static Module forModule(Module module)
public static Module forModule(java.lang.Object module, ModuleAnnotatedMethodScanner scanner)
public static Module forObject(java.lang.Object object)
This will skip bytecode generation for provider methods, since it is assumed that callers are only interested in Module metadata.
private static Module forObject(java.lang.Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)
public java.lang.Object getDelegateModule()
public void configure(Binder binder)
Module
binder
.
Do not invoke this method directly to install submodules. Instead use
Binder.install(Module)
, which ensures that provider methods
are
discovered.
public java.util.List<ProviderMethod<?>> getProviderMethods(Binder binder)
private com.google.common.base.Optional<java.lang.annotation.Annotation> isProvider(Binder binder, java.lang.reflect.Method method)
private static boolean overrides(java.lang.reflect.Method a, java.lang.reflect.Method b)
private <T> ProviderMethod<T> createProviderMethod(Binder binder, java.lang.reflect.Method method, java.lang.annotation.Annotation annotation)
<T> Key<T> getKey(Errors errors, TypeLiteral<T> type, java.lang.reflect.Member member, java.lang.annotation.Annotation[] annotations)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object