1 |
| package net.sourceforge.pmd.renderers; |
2 |
| |
3 |
| import java.io.IOException; |
4 |
| import java.io.StringWriter; |
5 |
| |
6 |
| import net.sourceforge.pmd.Report; |
7 |
| |
8 |
| public abstract class AbstractRenderer implements Renderer { |
9 |
| |
10 |
| protected boolean showSuppressedViolations = true; |
11 |
| |
12 |
0
| public void showSuppressedViolations(boolean show) {
|
13 |
0
| this.showSuppressedViolations = show;
|
14 |
| } |
15 |
| |
16 |
52
| public String render(Report report) {
|
17 |
52
| StringWriter w = new StringWriter();
|
18 |
52
| try {
|
19 |
52
| render(w, report);
|
20 |
| } catch (IOException e) { |
21 |
0
| throw new Error("StringWriter doesn't throw IOException", e);
|
22 |
| } |
23 |
43
| return w.toString();
|
24 |
| } |
25 |
| |
26 |
| } |