01: package org.acm.seguin.pmd.renderers;
02:
03: import org.acm.seguin.pmd.Report;
04: import org.acm.seguin.pmd.RuleViolation;
05:
06: import java.util.Iterator;
07:
08: public class EmacsRenderer implements Renderer {
09:
10: protected String EOL = System.getProperty("line.separator", "\n");
11:
12: public String render(Report report) {
13: StringBuffer buf = new StringBuffer();
14: for (Iterator i = report.iterator(); i.hasNext();) {
15: RuleViolation rv = (RuleViolation) i.next();
16: buf.append(EOL).append(rv.getFilename());
17: buf.append(":").append(Integer.toString(rv.getLine()));
18: buf.append(": ").append(rv.getDescription());
19: }
20: return buf.toString();
21: }
22: }
|