org.openide.filesystems.annotations
Class LayerGeneratingProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.openide.filesystems.annotations.LayerGeneratingProcessor
- All Implemented Interfaces:
- Processor
public abstract class LayerGeneratingProcessor
- extends AbstractProcessor
Convenience base class for an annotation processor which creates XML layer entries.
- Since:
- org.openide.filesystems 7.15
- See Also:
XMLFileSystem
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LayerGeneratingProcessor
protected LayerGeneratingProcessor()
- For access by subclasses.
process
public final boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
- Specified by:
process
in interface Processor
- Specified by:
process
in class AbstractProcessor
handleProcess
protected abstract boolean handleProcess(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
throws LayerGenerationException
- The regular body of
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.
- Parameters:
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)
- Returns:
- as in
process(java.util.Set extends javax.lang.model.element.TypeElement>, javax.annotation.processing.RoundEnvironment)
- Throws:
LayerGenerationException
- in case some layer fragment cannot be generated (a user-level error will be reported for you)
layer
protected final LayerBuilder layer(Element... originatingElements)
- Access the generated XML layer.
May already have content from a previous compilation run which should be overwritten.
May also have content from other layer-generated processors which should be appended to.
Simply make changes to the layer and they will be written to disk at the end of the job.
- Parameters:
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
- Returns:
- a builder permitting you to add layer entries