@AutoService(value=javax.annotation.processing.Processor.class) public final class GlideAnnotationProcessor extends AbstractProcessor
This processor discovers all AppGlideModule and
LibraryGlideModule implementations that are
annotated with GlideModule. Any implementations missing the
annotation will be ignored.
This processor also discovers all GlideExtension
annotated classes.
Multiple classes are generated by this processor:
LibraryGlideModules - A GlideIndexer class in a
specific package that will later be used by the processor to discover all
LibraryGlideModule classes.
AppGlideModules - A single
AppGlideModule implementation
(GeneratedAppGlideModule) that calls all
LibraryGlideModules and the
original AppGlideModule in the correct order when Glide is
initialized.
GlideExtensions -
RequestOptions implementation that contains
static versions of all builder methods in the base class and both static and instance
versions of methods in all GlideExtensions.
GlideExtension annotated classes are annotated with
GlideType:
RequestManager implementation containing a generated
method for each method annotated with
GlideType.
RequestManagerRetriever.RequestManagerFactory
implementation that produces the generated RequestManagers.
Glide look-alike that implements all static methods in
the Glide singleton and returns the generated
RequestManager implementation when appropriate.
AppGlideModule implementations must only be included in
applications, not in libraries. There must be exactly one
AppGlideModule implementation per
Application. The AppGlideModule class is
used as a signal that all modules have been found and that the final merged
GeneratedAppGlideModule impl can be created.
processingEnv| Constructor and Description |
|---|
GlideAnnotationProcessor() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getSupportedAnnotationTypes() |
SourceVersion |
getSupportedSourceVersion() |
void |
init(ProcessingEnvironment processingEnvironment) |
boolean |
process(Set<? extends TypeElement> set,
RoundEnvironment env)
Each round we do the following:
Find all AppGlideModules and save them to an instance variable (throw if > 1).
|
getCompletions, getSupportedOptions, isInitializedpublic void init(ProcessingEnvironment processingEnvironment)
init in interface Processorinit in class AbstractProcessorpublic Set<String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes in interface ProcessorgetSupportedAnnotationTypes in class AbstractProcessorpublic SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion in interface ProcessorgetSupportedSourceVersion in class AbstractProcessorpublic boolean process(Set<? extends TypeElement> set, RoundEnvironment env)
process in interface Processorprocess in class AbstractProcessor