01: package net.sourceforge.pmd.dcd.asm;
02:
03: public class PrintVisitor {
04:
05: private static final String INDENT = "\t";
06:
07: private final int level;
08:
09: public PrintVisitor() {
10: this (0);
11: }
12:
13: public PrintVisitor(PrintVisitor parent) {
14: this (parent.level + 2);
15: }
16:
17: public PrintVisitor(int level) {
18: this .level = level;
19: }
20:
21: protected void println(String s) {
22: println(this .level, s);
23: }
24:
25: protected void printlnIndent(String s) {
26: println(this .level + 1, s);
27: }
28:
29: private void println(int level, String s) {
30: for (int i = 0; i < level; i++) {
31: System.out.print(INDENT);
32: }
33: System.out.println(s);
34: }
35: }
|