org.openide.filesystems 7.32.1 1

org.openide.filesystems.annotations
Class LayerGeneratingProcessor

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by 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

Field Summary
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
protected LayerGeneratingProcessor()
          For access by subclasses.
 
Method Summary
protected abstract  boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
          The regular body of process(java.util.Set, javax.annotation.processing.RoundEnvironment).
protected  LayerBuilder layer(Element... originatingElements)
          Access the generated XML layer.
 boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
           
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, init, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayerGeneratingProcessor

protected LayerGeneratingProcessor()
For access by subclasses.

Method Detail

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, 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, javax.annotation.processing.RoundEnvironment)
roundEnv - as in process(java.util.Set, javax.annotation.processing.RoundEnvironment)
Returns:
as in process(java.util.Set, 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

org.openide.filesystems 7.32.1 1

Built on February 22 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.