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
ProcessesAutoService
annotations 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()
SourceVersion
getSupportedSourceVersion()
boolean
process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
For each class annotated withAutoService
Verify theAutoService
interface value is correct Categorize the class by its service interface For eachAutoService
interface Create a file namedMETA-INF/services/<interface>
For eachAutoService
annotated 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:
getSupportedAnnotationTypes
in interfaceProcessor
- Overrides:
getSupportedAnnotationTypes
in classAbstractProcessor
-
getSupportedSourceVersion
public SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion
in interfaceProcessor
- Overrides:
getSupportedSourceVersion
in classAbstractProcessor
-
process
public 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
- Verify the
- 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
- Create a file named
- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
- For each class annotated with
-
-