Package com.google.inject.internal
Class ProviderMethodsModule
- java.lang.Object
-
- com.google.inject.internal.ProviderMethodsModule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classProviderMethodsModule.MethodAndAnnotationprivate static classProviderMethodsModule.Signature
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectdelegateprivate ModuleAnnotatedMethodScannerscannerprivate booleanskipFastClassGenerationprivate TypeLiteral<?>typeLiteral
-
Constructor Summary
Constructors Modifier Constructor Description privateProviderMethodsModule(java.lang.Object delegate, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Binder binder)Contributes bindings and other configurations for this module tobinder.private <T> ProviderMethod<T>createProviderMethod(Binder binder, java.lang.reflect.Method method, java.lang.annotation.Annotation annotation)booleanequals(java.lang.Object o)static ModuleforModule(Module module)Returns a module which creates bindings for provider methods from the given module.static ModuleforModule(java.lang.Object module, ModuleAnnotatedMethodScanner scanner)Returns a module which creates bindings methods in the module that match the scanner.static ModuleforObject(java.lang.Object object)Returns a module which creates bindings for provider methods from the given object.private static ModuleforObject(java.lang.Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)private java.lang.annotation.AnnotationgetAnnotation(Binder binder, java.lang.reflect.Method method)Returns the annotation that is claimed by the scanner, or null if there is none.java.lang.Class<?>getDelegateModuleClass()(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)inthashCode()private booleanisStaticModule()private static booleanoverrides(java.lang.reflect.Method a, java.lang.reflect.Method b)Returns true if a overrides b, assumes that the signatures match
-
-
-
Field Detail
-
delegate
private final java.lang.Object delegate
-
typeLiteral
private final TypeLiteral<?> typeLiteral
-
skipFastClassGeneration
private final boolean skipFastClassGeneration
-
scanner
private final ModuleAnnotatedMethodScanner scanner
-
-
Constructor Detail
-
ProviderMethodsModule
private ProviderMethodsModule(java.lang.Object delegate, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)
-
-
Method Detail
-
forModule
public static Module forModule(Module module)
Returns a module which creates bindings for provider methods from the given module.
-
forModule
public static Module forModule(java.lang.Object module, ModuleAnnotatedMethodScanner scanner)
Returns a module which creates bindings methods in the module that match the scanner.
-
forObject
public static Module forObject(java.lang.Object object)
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(java.lang.Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner)
-
getDelegateModuleClass
public java.lang.Class<?> getDelegateModuleClass()
-
isStaticModule
private boolean isStaticModule()
-
configure
public void configure(Binder binder)
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
public java.util.List<ProviderMethod<?>> getProviderMethods(Binder binder)
-
getAnnotation
private java.lang.annotation.Annotation getAnnotation(Binder binder, java.lang.reflect.Method method)
Returns the annotation that is claimed by the scanner, or null if there is none.
-
overrides
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
-
createProviderMethod
private <T> ProviderMethod<T> createProviderMethod(Binder binder, java.lang.reflect.Method method, java.lang.annotation.Annotation annotation)
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-