com.sun.tools.javac.processing
Class PrintingProcessor.PrintingElementVisitor

java.lang.Object
  extended by javax.lang.model.util.AbstractElementVisitor6<R,P>
      extended by javax.lang.model.util.SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
          extended by com.sun.tools.javac.processing.PrintingProcessor.PrintingElementVisitor
All Implemented Interfaces:
ElementVisitor<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Enclosing class:
PrintingProcessor

public static class PrintingProcessor.PrintingElementVisitor
extends SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>

Used for the -Xprint option and called by Elements.printElements


Field Summary
(package private)  Elements elementUtils
           
(package private)  int indentation
           
private static java.lang.String[] spaces
           
(package private)  java.io.PrintWriter writer
           
 
Fields inherited from class javax.lang.model.util.SimpleElementVisitor6
DEFAULT_VALUE
 
Constructor Summary
PrintingProcessor.PrintingElementVisitor(java.io.Writer w, Elements elementUtils)
           
 
Method Summary
protected  PrintingProcessor.PrintingElementVisitor defaultAction(Element e, java.lang.Boolean newLine)
          The default action for visit methods.
 void flush()
           
private  void indent()
           
private  void printAnnotations(Element e)
           
private  void printAnnotationsInline(Element e)
           
private  void printDocComment(Element e)
           
private  void printFormalTypeParameters(ExecutableElement executable)
           
private  void printFormalTypeParameters(java.util.List<? extends TypeParameterElement> typeParams, boolean pad)
           
private  void printFormalTypeParameters(TypeElement type)
           
private  void printInterfaces(TypeElement e)
           
private  void printModifiers(Element e)
           
private  void printParameters(ExecutableElement e)
           
private  void printThrows(ExecutableElement e)
           
 PrintingProcessor.PrintingElementVisitor visitExecutable(ExecutableElement e, java.lang.Boolean p)
          Visits an executable element. This implementation calls defaultAction.
 PrintingProcessor.PrintingElementVisitor visitPackage(PackageElement e, java.lang.Boolean p)
          Visits a package element. This implementation calls defaultAction.
 PrintingProcessor.PrintingElementVisitor visitType(TypeElement e, java.lang.Boolean p)
          Visits a type element. This implementation calls defaultAction.
 PrintingProcessor.PrintingElementVisitor visitTypeParameter(TypeParameterElement e, java.lang.Boolean p)
          Visits a type parameter element. This implementation calls defaultAction.
 PrintingProcessor.PrintingElementVisitor visitVariable(VariableElement e, java.lang.Boolean newLine)
          Visits a variable element. This implementation calls defaultAction.
 
Methods inherited from class javax.lang.model.util.AbstractElementVisitor6
visit, visit, visitUnknown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indentation

int indentation

writer

final java.io.PrintWriter writer

elementUtils

final Elements elementUtils

spaces

private static final java.lang.String[] spaces
Constructor Detail

PrintingProcessor.PrintingElementVisitor

public PrintingProcessor.PrintingElementVisitor(java.io.Writer w,
                                                Elements elementUtils)
Method Detail

defaultAction

protected PrintingProcessor.PrintingElementVisitor defaultAction(Element e,
                                                                 java.lang.Boolean newLine)
Description copied from class: SimpleElementVisitor6
The default action for visit methods. The implementation in this class just returns SimpleElementVisitor6.DEFAULT_VALUE; subclasses will commonly override this method.

Overrides:
defaultAction in class SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Parameters:
e - the element to process
newLine - a visitor-specified parameter
Returns:
DEFAULT_VALUE unless overridden

visitExecutable

public PrintingProcessor.PrintingElementVisitor visitExecutable(ExecutableElement e,
                                                                java.lang.Boolean p)
Description copied from class: SimpleElementVisitor6
Visits an executable element. This implementation calls defaultAction.

Specified by:
visitExecutable in interface ElementVisitor<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Overrides:
visitExecutable in class SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
the result of defaultAction

visitType

public PrintingProcessor.PrintingElementVisitor visitType(TypeElement e,
                                                          java.lang.Boolean p)
Description copied from class: SimpleElementVisitor6
Visits a type element. This implementation calls defaultAction.

Specified by:
visitType in interface ElementVisitor<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Overrides:
visitType in class SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
the result of defaultAction

visitVariable

public PrintingProcessor.PrintingElementVisitor visitVariable(VariableElement e,
                                                              java.lang.Boolean newLine)
Description copied from class: SimpleElementVisitor6
Visits a variable element. This implementation calls defaultAction.

Specified by:
visitVariable in interface ElementVisitor<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Overrides:
visitVariable in class SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Parameters:
e - the element to visit
newLine - a visitor-specified parameter
Returns:
the result of defaultAction

visitTypeParameter

public PrintingProcessor.PrintingElementVisitor visitTypeParameter(TypeParameterElement e,
                                                                   java.lang.Boolean p)
Description copied from class: SimpleElementVisitor6
Visits a type parameter element. This implementation calls defaultAction.

Specified by:
visitTypeParameter in interface ElementVisitor<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Overrides:
visitTypeParameter in class SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
the result of defaultAction

visitPackage

public PrintingProcessor.PrintingElementVisitor visitPackage(PackageElement e,
                                                             java.lang.Boolean p)
Description copied from class: SimpleElementVisitor6
Visits a package element. This implementation calls defaultAction.

Specified by:
visitPackage in interface ElementVisitor<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Overrides:
visitPackage in class SimpleElementVisitor6<PrintingProcessor.PrintingElementVisitor,java.lang.Boolean>
Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
the result of defaultAction

flush

public void flush()

printDocComment

private void printDocComment(Element e)

printModifiers

private void printModifiers(Element e)

printFormalTypeParameters

private void printFormalTypeParameters(ExecutableElement executable)

printFormalTypeParameters

private void printFormalTypeParameters(TypeElement type)

printFormalTypeParameters

private void printFormalTypeParameters(java.util.List<? extends TypeParameterElement> typeParams,
                                       boolean pad)

printAnnotationsInline

private void printAnnotationsInline(Element e)

printAnnotations

private void printAnnotations(Element e)

printParameters

private void printParameters(ExecutableElement e)

printInterfaces

private void printInterfaces(TypeElement e)

printThrows

private void printThrows(ExecutableElement e)

indent

private void indent()