public abstract class ModuleAnnotatedMethodScanner extends Object
@Provides methods.
| Constructor and Description |
|---|
ModuleAnnotatedMethodScanner()
|
| Modifier and Type | Method and Description |
|---|---|
abstract Set |
annotationClasses()
Returns the annotations this should scan for.
|
abstract <T> Key |
prepareMethod(Binder
Prepares a method for binding.
|
public abstract Set<? extends Class <? extends Annotation >> annotationClasses()
public abstract <T> Key<T> prepareMethod(Binder binder, Annotation annotation, Key <T> key, InjectionPoint injectionPoint)
key parameter is the key discovered from looking at the binding annotation and return value of the method. Implementations can modify the key to instead bind to another key. For example, Multibinder may want to change
@SetProvides String provideFoo() to bind into a unique Key within the multibinder instead of binding
String.
The injection point and annotation are provided in case the implementation wants to set the key based on the property of the annotation or if any additional preparation is needed for any of the dependencies. The annotation is guaranteed to be an instance of one the classes returned by annotationClasses().