@SupportedOptions(value={"debug","verify"})
public class AutoServiceProcessor
extends javax.annotation.processing.AbstractProcessor
AutoService annotations and generates the service provider
configuration files described in ServiceLoader.
Processor Options:
| Constructor and Description |
|---|
AutoServiceProcessor() |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.collect.ImmutableSet<java.lang.String> |
getSupportedAnnotationTypes() |
javax.lang.model.SourceVersion |
getSupportedSourceVersion() |
boolean |
process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
javax.annotation.processing.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
|
public com.google.common.collect.ImmutableSet<java.lang.String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes in interface javax.annotation.processing.ProcessorgetSupportedAnnotationTypes in class javax.annotation.processing.AbstractProcessorpublic javax.lang.model.SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion in interface javax.annotation.processing.ProcessorgetSupportedSourceVersion in class javax.annotation.processing.AbstractProcessorpublic boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
javax.annotation.processing.RoundEnvironment roundEnv)
AutoServiceAutoService interface value is correct
AutoService interface META-INF/services/<interface>
AutoService annotated class for this interface process in interface javax.annotation.processing.Processorprocess in class javax.annotation.processing.AbstractProcessorCopyright © 2019 Google, Inc.. All Rights Reserved.