Class AutoServiceProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- com.google.auto.service.processor.AutoServiceProcessor
-
- All Implemented Interfaces:
Processor
@SupportedOptions({"debug","verify"}) public class AutoServiceProcessor extends AbstractProcessor
ProcessesAutoServiceannotations and generates the service provider configuration files described inServiceLoader.Processor Options:
- debug - turns on debug statements
-
-
Field Summary
-
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
-
-
Constructor Summary
Constructors Constructor Description AutoServiceProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<String>getSupportedAnnotationTypes()SourceVersiongetSupportedSourceVersion()booleanprocess(Set<? extends TypeElement> annotations, 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-
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedOptions, init, isInitialized
-
-
-
-
Method Detail
-
getSupportedAnnotationTypes
public com.google.common.collect.ImmutableSet<String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypesin interfaceProcessor- Overrides:
getSupportedAnnotationTypesin classAbstractProcessor
-
getSupportedSourceVersion
public SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-
process
public boolean process(Set<? extends TypeElement> annotations, 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 interfaceProcessor- Specified by:
processin classAbstractProcessor
- For each class annotated with
-
-