Пример #1
0
 /**
  * Create a Renderer instance based upon the configured reporting options. If withReportWriter
  * then we'll configure it with a writer for the reportFile specified.
  *
  * @param withReportWriter whether to configure a writer or not
  * @return A Renderer instance.
  */
 public Renderer createRenderer(boolean withReportWriter) {
   Renderer renderer = RendererFactory.createRenderer(reportFormat, reportProperties);
   renderer.setShowSuppressedViolations(showSuppressedViolations);
   if (withReportWriter) {
     renderer.setWriter(IOUtil.createWriter(reportFile));
   }
   return renderer;
 }
Пример #2
0
  public Renderer[] availableRenderers2() {

    List<Renderer> renderers = new ArrayList<Renderer>();

    for (String reportName : RendererFactory.REPORT_FORMAT_TO_RENDERER.keySet()) {
      renderers.add(RendererFactory.createRenderer(reportName, new Properties()));
    }

    return renderers.toArray(new Renderer[renderers.size()]);
  }