View Javadoc

1   package net.sourceforge.pmd.util.designer;
2   
3   import java.io.PrintStream;
4   
5   public class MyPrintStream extends PrintStream {
6   
7       private StringBuffer buf = new StringBuffer();
8   	
9   	private static final String LINE_SEPARATOR = System.getProperty("line.separator");
10  	
11      public MyPrintStream() {
12          super(System.out);
13      }
14  
15      public void println(String s) {
16          super.println(s);
17          buf.append(s);
18          buf.append(LINE_SEPARATOR);
19      }
20  
21      public String getString() {
22          return buf.toString();
23      }
24  }
25