@SupportedAnnotationTypes(value="com.google.appengine.spi.ServiceProvider")
@SupportedOptions(value={"debug","verify"})
public class ServiceProviderProcessor
extends javax.annotation.processing.AbstractProcessor
ServiceProvider
annotations and generates the service provider
configuration files described in ServiceLoader
.
Processor Options:
Constructor and Description |
---|
ServiceProviderProcessor() |
Modifier and Type | Method and Description |
---|---|
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 @ServiceProvider
Verify the @ServiceProvider interface value is correct
Categorize the class by its ServiceProvider interface
For each @ServiceProvider interface
Create a file named
META-INF/services/<interface>
For each @ServiceProvider annotated class for this interface
Create an entry in the file
|
public javax.lang.model.SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion
in interface javax.annotation.processing.Processor
getSupportedSourceVersion
in class javax.annotation.processing.AbstractProcessor
public boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
META-INF/services/<interface>
process
in interface javax.annotation.processing.Processor
process
in class javax.annotation.processing.AbstractProcessor