1 4 package net.sourceforge.pmd.renderers; 5 6 import net.sourceforge.pmd.IRuleViolation; 7 import net.sourceforge.pmd.PMD; 8 import net.sourceforge.pmd.Report; 9 10 import java.io.IOException ; 11 import java.io.Writer ; 12 import java.util.Iterator ; 13 14 29 public class TextPadRenderer extends AbstractRenderer { 30 public void render(Writer writer, Report report) throws IOException { 31 StringBuffer buf = new StringBuffer (); 32 Iterator i; 33 try { 34 i = report.iterator(); 35 } catch (NullPointerException npx) { 36 throw new NullPointerException ("ERROR in " + this.getClass().getName() + ".render: Parameter report is null."); 37 } 38 while (i.hasNext()) { 39 IRuleViolation rv = (IRuleViolation) i.next(); 40 buf.setLength(0); 41 buf.append(PMD.EOL).append(rv.getFilename() + "("); 43 buf.append(Integer.toString(rv.getBeginLine())).append(", "); 45 buf.append(rv.getRule().getName()).append("): "); 47 buf.append(rv.getDescription()); 49 writer.write(buf.toString()); 50 } 51 } 52 } 53 | Popular Tags |