public void writeToStdOut(PrettyPrinter p) { p.printf("<JForStatement line=\"%d\">\n", line()); p.indentRight(); p.printf("<Initialization>\n"); p.indentRight(); initialize.writeToStdOut(p); p.indentLeft(); p.printf("</Initialization>\n"); p.printf("<Termination>\n"); p.indentRight(); terminate.writeToStdOut(p); p.indentLeft(); p.printf("</Termination>\n"); p.printf("<Update>\n"); p.indentRight(); update.writeToStdOut(p); p.indentLeft(); p.printf("</Update>\n"); p.printf("<Consequent>\n"); p.indentRight(); block.writeToStdOut(p); p.indentLeft(); p.printf("</Consequent>\n"); p.indentLeft(); p.printf("</JForStatement>\n"); }
/** @inheritDoc */ public void writeToStdOut(PrettyPrinter p) { p.printf("<JFieldDeclaration line=\"%d\"/>\n", line()); p.indentRight(); if (mods != null) { p.println("<Modifiers>"); p.indentRight(); for (String mod : mods) { p.printf("<Modifier name=\"%s\"/>\n", mod); } p.indentLeft(); p.println("</Modifiers>"); } if (decls != null) { p.println("<VariableDeclarators>"); for (JVariableDeclarator decl : decls) { p.indentRight(); decl.writeToStdOut(p); p.indentLeft(); } p.println("<VariableDeclarators>"); } p.indentLeft(); p.println("</JFieldDeclaration>"); }