com.sun.tools.javac.processing
Class PrintingProcessor

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by com.sun.tools.javac.processing.PrintingProcessor
All Implemented Interfaces:
Processor

@SupportedAnnotationTypes(value="*")
@SupportedSourceVersion(value=RELEASE_6)
public class PrintingProcessor
extends AbstractProcessor

A processor which prints out elements. Used to implement the -Xprint option; the included visitor class is used to implement Elements.printElements.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Nested Class Summary
static class PrintingProcessor.PrintingElementVisitor
          Used for the -Xprint option and called by Elements.printElements
 
Field Summary
(package private)  java.io.PrintWriter writer
           
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
PrintingProcessor()
           
 
Method Summary
(package private)  void print(Element element)
           
 boolean process(java.util.Set<? extends TypeElement> tes, RoundEnvironment renv)
          Processes a set of annotation types on type elements originating from the prior round and returns whether or not these annotations are claimed by this processor.
 void setWriter(java.io.Writer w)
           
 
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
 

Field Detail

writer

java.io.PrintWriter writer
Constructor Detail

PrintingProcessor

public PrintingProcessor()
Method Detail

setWriter

public void setWriter(java.io.Writer w)

process

public boolean process(java.util.Set<? extends TypeElement> tes,
                       RoundEnvironment renv)
Description copied from class: AbstractProcessor
Processes a set of annotation types on type elements originating from the prior round and returns whether or not these annotations are claimed by this processor. If true is returned, the annotations are claimed and subsequent processors will not be asked to process them; if false is returned, the annotations are unclaimed and subsequent processors may be asked to process them. A processor may always return the same boolean value or may vary the result based on chosen criteria.

The input set will be empty if the processor supports "*" and the root elements have no annotations. A Processor must gracefully handle an empty set of annotations.

Specified by:
process in interface Processor
Specified by:
process in class AbstractProcessor
Parameters:
tes - the annotation types requested to be processed
renv - environment for information about the current and prior round
Returns:
whether or not the set of annotations are claimed by this processor

print

void print(Element element)