View Javadoc

    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      public void showSuppressedViolations(boolean show) {
    13          this.showSuppressedViolations = show;
    14      }
    15
    16      public String render(Report report) {
    17          StringWriter w = new StringWriter();
    18          try {
    19              render(w, report);
    20          } catch (IOException e) {
    21              throw new Error("StringWriter doesn't throw IOException", e);
    22          }
    23          return w.toString();
    24      }
    25
    26  }