01: package net.sourceforge.pmd.renderers;
02:
03: import java.io.IOException;
04: import java.io.Writer;
05:
06: import net.sourceforge.pmd.Report;
07: import net.sourceforge.pmd.dfa.report.ReportHTMLPrintVisitor;
08: import net.sourceforge.pmd.dfa.report.ReportTree;
09:
10: public class YAHTMLRenderer extends AbstractRenderer {
11:
12: private String outputDir;
13:
14: public YAHTMLRenderer() {
15: // TODO output destination
16: }
17:
18: public YAHTMLRenderer(String outputDir) {
19: this .outputDir = outputDir;
20: };
21:
22: public void render(Writer writer, Report report) throws IOException {
23: ReportTree tree = report.getViolationTree();
24: tree.getRootNode().accept(
25: new ReportHTMLPrintVisitor(outputDir == null ? ".."
26: : outputDir));
27: writer.write("<h3 align=\"center\">The HTML files are located "
28: + (outputDir == null ? "above the project directory"
29: : ("in '" + outputDir + '\'')) + ".</h3>");
30:
31: }
32:
33: }
|