@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:
LibraryGlideModule
s - A GlideIndexer class in a
specific package that will later be used by the processor to discover all
LibraryGlideModule
classes.
AppGlideModule
s - A single
AppGlideModule
implementation
(GeneratedAppGlideModule
) that calls all
LibraryGlideModule
s and the
original AppGlideModule
in the correct order when Glide is
initialized.
GlideExtension
s -
RequestOptions
implementation that contains
static versions of all builder methods in the base class and both static and instance
versions of methods in all GlideExtension
s.
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 RequestManager
s.
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, isInitialized
public void init(ProcessingEnvironment processingEnvironment)
init
in interface Processor
init
in class AbstractProcessor
public Set<String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes
in interface Processor
getSupportedAnnotationTypes
in class AbstractProcessor
public SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion
in interface Processor
getSupportedSourceVersion
in class AbstractProcessor
public boolean process(Set<? extends TypeElement> set, RoundEnvironment env)
process
in interface Processor
process
in class AbstractProcessor