Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 28 |  | Methods: | 1
| NCLOC: | 20 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
EmacsRenderer.java | 100% | 100% | 100% | 100% |

1 |  | /**
2 |  | * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3 |  | */
4 |  | package net.sourceforge.pmd.renderers;
5 |  |
6 |  | import net.sourceforge.pmd.IRuleViolation;
7 |  | import net.sourceforge.pmd.Report;
8 |  |
9 |  | import java.io.IOException;
10 |  | import java.io.Writer;
11 |  | import java.util.Iterator;
12 |  |
13 |  | public class EmacsRenderer extends AbstractRenderer {
14 |  |
15 |  | protected static final String EOL = System.getProperty("line.separator", "\n");
16 |  |
17 | 5 | public void render(Writer writer, Report report) throws IOException {
18 | 5 | StringBuffer buf = new StringBuffer();
19 | 5 | for (Iterator i = report.iterator(); i.hasNext();) {
20 | 3 | IRuleViolation rv = (IRuleViolation) i.next();
21 | 3 | buf.setLength(0);
22 | 3 | buf.append(EOL).append(rv.getFilename());
23 | 3 | buf.append(':').append(Integer.toString(rv.getBeginLine()));
24 | 3 | buf.append(": ").append(rv.getDescription());
25 | 3 | writer.write(buf.toString());
26 |  | }
27 |  | }
28 |  | }