com.google.auto.service.processor
Class AutoServiceProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
com.google.auto.service.processor.AutoServiceProcessor
- All Implemented Interfaces:
- Processor
@SupportedOptions(value={"debug","verify"})
public class AutoServiceProcessor- extends AbstractProcessor
Processes AutoService annotations and generates the service provider
configuration files described in ServiceLoader.
Processor Options:
- debug - turns on debug statements
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AutoServiceProcessor
public AutoServiceProcessor()
getSupportedAnnotationTypes
public com.google.common.collect.ImmutableSet<String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypes in interface Processor- Overrides:
getSupportedAnnotationTypes in class AbstractProcessor
getSupportedSourceVersion
public SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion in interface Processor- Overrides:
getSupportedSourceVersion in class AbstractProcessor
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
- 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
- Specified by:
process in interface Processor- Specified by:
process in class AbstractProcessor
Copyright © 2014 Google, Inc.. All rights reserved.