@SupportedOptions(value={"debug","verify"}) public class AutoServiceProcessor extends AbstractProcessor
AutoService
annotations and generates the service provider
configuration files described in ServiceLoader
.
Processor Options:
processingEnv
Constructor and Description |
---|
AutoServiceProcessor() |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<String> |
getSupportedAnnotationTypes() |
SourceVersion |
getSupportedSourceVersion() |
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
For each class annotated with
AutoService
Verify the AutoService interface value is correct
Categorize the class by its service interface
For each AutoService interface
Create a file named META-INF/services/<interface>
For each AutoService annotated class for this interface
Create an entry in the file
|
getCompletions, getSupportedOptions, init, isInitialized
public com.google.common.collect.ImmutableSet<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> annotations, RoundEnvironment roundEnv)
AutoService
AutoService
interface value is correct
AutoService
interface META-INF/services/<interface>
AutoService
annotated class for this interface process
in interface Processor
process
in class AbstractProcessor
Copyright © 2022. All rights reserved.