public abstract class LayerGeneratingProcessor extends AbstractProcessor
XMLFileSystem
processingEnv
Modifier | Constructor and Description |
---|---|
protected |
LayerGeneratingProcessor()
For access by subclasses.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
handleProcess(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
|
protected LayerBuilder |
layer(Element... originatingElements)
Access the generated XML layer.
|
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) |
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, init, isInitialized
protected LayerGeneratingProcessor()
public final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
process
in interface Processor
process
in class AbstractProcessor
protected abstract boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException
process(java.util.Set<? extends javax.lang.model.element.TypeElement>, javax.annotation.processing.RoundEnvironment)
.
In the last round, one of the layer-generating processors will write out generated-layer.xml.
Do not attempt to read or write the layer file directly; just use layer(javax.lang.model.element.Element...)
.
You may however wish to create other resource files yourself: see LayerBuilder.File.url
for syntax.
annotations
- as in process(java.util.Set<? extends javax.lang.model.element.TypeElement>, javax.annotation.processing.RoundEnvironment)
roundEnv
- as in process(java.util.Set<? extends javax.lang.model.element.TypeElement>, javax.annotation.processing.RoundEnvironment)
process(java.util.Set<? extends javax.lang.model.element.TypeElement>, javax.annotation.processing.RoundEnvironment)
LayerGenerationException
- in case some layer fragment cannot be generated (a user-level error will be reported for you)protected final LayerBuilder layer(Element... originatingElements)
originatingElements
- as in Filer.createResource(javax.tools.JavaFileManager.Location, java.lang.CharSequence, java.lang.CharSequence, javax.lang.model.element.Element...)
;
optional but (if exactly one is passed) may be used for error reporting as well as identification of Java instances