Home » openjdk-7 » com.sun.tools » javac » tree » [javadoc | source]
com.sun.tools.javac.tree
public class: Pretty [javadoc | source]
java.lang.Object
   com.sun.tools.javac.tree.JCTree.Visitor
      com.sun.tools.javac.tree.Pretty
Prints out a tree as an indented Java source program.

This is NOT part of any supported API. 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.
Field Summary
 Writer out    The output stream on which trees are printed. 
public  int width    Indentation width (can be reassigned from outside). 
 int lmargin    The current left margin. 
 Name enclClassName    The enclosing class name. 
 Map<JCTree, String> docComments    A hashtable mapping trees to their documentation comments (can be null) 
 String lineSep     
 int prec    Visitor argument: the current precedence level. 
Constructor:
 public Pretty(Writer out,
    boolean sourceOutput) 
Method from com.sun.tools.javac.tree.Pretty Summary:
align,   close,   indent,   isEnumerator,   isUsed,   lineEndPos,   open,   operatorName,   print,   printAnnotations,   printBlock,   printDocComment,   printEnumBody,   printExpr,   printExpr,   printExprs,   printExprs,   printFlags,   printStat,   printStats,   printTypeParameters,   printUnit,   println,   undent,   visitAnnotation,   visitApply,   visitAssert,   visitAssign,   visitAssignop,   visitBinary,   visitBlock,   visitBreak,   visitCase,   visitCatch,   visitClassDef,   visitConditional,   visitContinue,   visitDoLoop,   visitErroneous,   visitExec,   visitForLoop,   visitForeachLoop,   visitIdent,   visitIf,   visitImport,   visitIndexed,   visitLabelled,   visitLetExpr,   visitLiteral,   visitMethodDef,   visitModifiers,   visitNewArray,   visitNewClass,   visitParens,   visitReturn,   visitSelect,   visitSkip,   visitSwitch,   visitSynchronized,   visitThrow,   visitTopLevel,   visitTree,   visitTry,   visitTypeApply,   visitTypeArray,   visitTypeBoundKind,   visitTypeCast,   visitTypeIdent,   visitTypeParameter,   visitTypeTest,   visitTypeUnion,   visitUnary,   visitVarDef,   visitWhileLoop,   visitWildcard
Methods from com.sun.tools.javac.tree.JCTree$Visitor:
visitAnnotation,   visitApply,   visitAssert,   visitAssign,   visitAssignop,   visitBinary,   visitBlock,   visitBreak,   visitCase,   visitCatch,   visitClassDef,   visitConditional,   visitContinue,   visitDoLoop,   visitErroneous,   visitExec,   visitForLoop,   visitForeachLoop,   visitIdent,   visitIf,   visitImport,   visitIndexed,   visitLabelled,   visitLetExpr,   visitLiteral,   visitMethodDef,   visitModifiers,   visitNewArray,   visitNewClass,   visitParens,   visitReturn,   visitSelect,   visitSkip,   visitSwitch,   visitSynchronized,   visitThrow,   visitTopLevel,   visitTree,   visitTry,   visitTypeApply,   visitTypeArray,   visitTypeBoundKind,   visitTypeCast,   visitTypeIdent,   visitTypeParameter,   visitTypeTest,   visitTypeUnion,   visitUnary,   visitVarDef,   visitWhileLoop,   visitWildcard
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.tree.Pretty Detail:
  void align() throws IOException 
    Align code to be indented to left margin.
  void close(int contextPrec,
    int ownPrec) throws IOException 
    Leave precedence level. Emit a `(' if inner precedence level is less than precedence level we revert to.
  void indent() 
    Increase left margin by indentation width.
 boolean isEnumerator(JCTree t) 
    Is the given tree an enumerator definition?
 boolean isUsed(Symbol t,
    JCTree cdef) 
 static int lineEndPos(String s,
    int start) 
  void open(int contextPrec,
    int ownPrec) throws IOException 
    Enter a new precedence level. Emit a `(' if new precedence level is less than precedence level so far.
 public String operatorName(int tag) 
 public  void print(Object s) throws IOException 
    Print string, replacing all non-ascii character with unicode escapes.
 public  void printAnnotations(List<JCAnnotation> trees) throws IOException 
 public  void printBlock(List<JCTree> stats) throws IOException 
    Print a block.
 public  void printDocComment(JCTree tree) throws IOException 
    Print documentation comment, if it exists
 public  void printEnumBody(List<JCTree> stats) throws IOException 
    Print a block.
 public  void printExpr(JCTree tree) throws IOException 
    Derived visitor method: print expression tree at minimum precedence level for expression.
 public  void printExpr(JCTree tree,
    int prec) throws IOException 
    Visitor method: print expression tree.
 public  void printExprs(List<T> trees) throws IOException 
    Derived visitor method: print list of expression trees, separated by commas.
 public  void printExprs(List<T> trees,
    String sep) throws IOException 
    Derived visitor method: print list of expression trees, separated by given string.
 public  void printFlags(long flags) throws IOException 
    Print a set of modifiers.
 public  void printStat(JCTree tree) throws IOException 
    Derived visitor method: print statement tree.
 public  void printStats(List<JCTree> trees) throws IOException 
    Derived visitor method: print list of statements, each on a separate line.
 public  void printTypeParameters(List<JCTypeParameter> trees) throws IOException 
    If type parameter list is non-empty, print it enclosed in "<...>" brackets.
 public  void printUnit(JCCompilationUnit tree,
    JCClassDecl cdef) throws IOException 
    Print unit consisting of package clause and import statements in toplevel, followed by class definition. if class definition == null, print all definitions in toplevel.
 public  void println() throws IOException 
    Print new line.
  void undent() 
    Decrease left margin by indentation width.
 public  void visitAnnotation(JCAnnotation tree) 
 public  void visitApply(JCMethodInvocation tree) 
 public  void visitAssert(JCAssert tree) 
 public  void visitAssign(JCAssign tree) 
 public  void visitAssignop(JCAssignOp tree) 
 public  void visitBinary(JCBinary tree) 
 public  void visitBlock(JCBlock tree) 
 public  void visitBreak(JCBreak tree) 
 public  void visitCase(JCCase tree) 
 public  void visitCatch(JCCatch tree) 
 public  void visitClassDef(JCClassDecl tree) 
 public  void visitConditional(JCConditional tree) 
 public  void visitContinue(JCContinue tree) 
 public  void visitDoLoop(JCDoWhileLoop tree) 
 public  void visitErroneous(JCErroneous tree) 
 public  void visitExec(JCExpressionStatement tree) 
 public  void visitForLoop(JCForLoop tree) 
 public  void visitForeachLoop(JCEnhancedForLoop tree) 
 public  void visitIdent(JCIdent tree) 
 public  void visitIf(JCIf tree) 
 public  void visitImport(JCImport tree) 
 public  void visitIndexed(JCArrayAccess tree) 
 public  void visitLabelled(JCLabeledStatement tree) 
 public  void visitLetExpr(LetExpr tree) 
 public  void visitLiteral(JCLiteral tree) 
 public  void visitMethodDef(JCMethodDecl tree) 
 public  void visitModifiers(JCModifiers mods) 
 public  void visitNewArray(JCNewArray tree) 
 public  void visitNewClass(JCNewClass tree) 
 public  void visitParens(JCParens tree) 
 public  void visitReturn(JCReturn tree) 
 public  void visitSelect(JCFieldAccess tree) 
 public  void visitSkip(JCSkip tree) 
 public  void visitSwitch(JCSwitch tree) 
 public  void visitSynchronized(JCSynchronized tree) 
 public  void visitThrow(JCThrow tree) 
 public  void visitTopLevel(JCCompilationUnit tree) 
    Visitor methods ***************************
 public  void visitTree(JCTree tree) 
 public  void visitTry(JCTry tree) 
 public  void visitTypeApply(JCTypeApply tree) 
 public  void visitTypeArray(JCArrayTypeTree tree) 
 public  void visitTypeBoundKind(TypeBoundKind tree) 
 public  void visitTypeCast(JCTypeCast tree) 
 public  void visitTypeIdent(JCPrimitiveTypeTree tree) 
 public  void visitTypeParameter(JCTypeParameter tree) 
 public  void visitTypeTest(JCInstanceOf tree) 
 public  void visitTypeUnion(JCTypeUnion tree) 
 public  void visitUnary(JCUnary tree) 
 public  void visitVarDef(JCVariableDecl tree) 
 public  void visitWhileLoop(JCWhileLoop tree) 
 public  void visitWildcard(JCWildcard tree)