Class AutoServiceProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- com.google.auto.service.processor.AutoServiceProcessor
-
- All Implemented Interfaces:
javax.annotation.processing.Processor
@SupportedOptions({"debug","verify"}) public class AutoServiceProcessor extends javax.annotation.processing.AbstractProcessorProcessesAutoServiceannotations and generates the service provider configuration files described inServiceLoader.Processor Options:
-Adebug- turns on debug statements-Averify=true- turns on extra verification
-
-
Constructor Summary
Constructors Constructor Description AutoServiceProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<java.lang.String>getSupportedAnnotationTypes()javax.lang.model.SourceVersiongetSupportedSourceVersion()booleanprocess(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)For each class annotated withAutoServiceVerify theAutoServiceinterface value is correct Categorize the class by its service interface For eachAutoServiceinterface Create a file namedMETA-INF/services/<interface>For eachAutoServiceannotated class for this interface Create an entry in the file
-
-
-
Method Detail
-
getSupportedAnnotationTypes
public com.google.common.collect.ImmutableSet<java.lang.String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypesin interfacejavax.annotation.processing.Processor- Overrides:
getSupportedAnnotationTypesin classjavax.annotation.processing.AbstractProcessor
-
getSupportedSourceVersion
public javax.lang.model.SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersionin interfacejavax.annotation.processing.Processor- Overrides:
getSupportedSourceVersionin classjavax.annotation.processing.AbstractProcessor
-
process
public 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
AutoServiceinterface value is correct - Categorize the class by its service interface
- Verify the
- For each
AutoServiceinterface- Create a file named
META-INF/services/<interface> - For each
AutoServiceannotated class for this interface- Create an entry in the file
- Create a file named
- Specified by:
processin interfacejavax.annotation.processing.Processor- Specified by:
processin classjavax.annotation.processing.AbstractProcessor
- For each class annotated with
-
-