Package com.google.inject.internal
Class ProviderMethodsModule
java.lang.Object
com.google.inject.internal.ProviderMethodsModule
- All Implemented Interfaces:
Module
Creates bindings to methods annotated with @
Provides. Use the scope and
binding annotations on the provider method to configure the binding.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Objectprivate final ModuleAnnotatedMethodScannerprivate final booleanprivate final TypeLiteral<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateProviderMethodsModule(Object delegate, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner) -
Method Summary
Modifier and TypeMethodDescriptionvoidContributes bindings and other configurations for this module tobinder.private <T> ProviderMethod<T>createProviderMethod(Binder binder, Method method, Annotation annotation) booleanstatic ModuleReturns a module which creates bindings for provider methods from the given module.static ModuleforModule(Object module, ModuleAnnotatedMethodScanner scanner) Returns a module which creates bindings methods in the module that match the scanner.static ModuleReturns a module which creates bindings for provider methods from the given object.private static ModuleforObject(Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner) private AnnotationgetAnnotation(Binder binder, Method method) Returns the annotation that is claimed by the scanner, or null if there is none.Class<?>(package private) <T> Key<T>getKey(Errors errors, TypeLiteral<T> type, Member member, Annotation[] annotations) List<ProviderMethod<?>>getProviderMethods(Binder binder) inthashCode()private booleanprivate static booleanReturns true if a overrides b, assumes that the signatures match
-
Field Details
-
delegate
-
typeLiteral
-
skipFastClassGeneration
private final boolean skipFastClassGeneration -
scanner
-
-
Constructor Details
-
ProviderMethodsModule
private ProviderMethodsModule(Object delegate, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)
-
-
Method Details
-
forModule
Returns a module which creates bindings for provider methods from the given module. -
forModule
Returns a module which creates bindings methods in the module that match the scanner. -
forObject
Returns a module which creates bindings for provider methods from the given object. This is useful notably for GINThis will skip bytecode generation for provider methods, since it is assumed that callers are only interested in Module metadata.
-
forObject
private static Module forObject(Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner) -
getDelegateModuleClass
-
isStaticModule
private boolean isStaticModule() -
configure
Description copied from interface:ModuleContributes 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 methodsare discovered. -
getProviderMethods
-
getAnnotation
Returns the annotation that is claimed by the scanner, or null if there is none. -
overrides
Returns true if a overrides b, assumes that the signatures match -
createProviderMethod
private <T> ProviderMethod<T> createProviderMethod(Binder binder, Method method, Annotation annotation) -
getKey
-
equals
-
hashCode
public int hashCode()
-