case summary:
report = new TextReportGenerator(out, costModel, options);
break;
case html:
reportModel.setMessageBundle(bundleModel);
reportModel.setSourceLinker(new SourceLinkerModel(linker));
report = new FreemarkerReportGenerator(reportModel, out,
FreemarkerReportGenerator.HTML_REPORT_TEMPLATE, cfg);
break;
case props:
report = new PropertiesReportGenerator(out, costModel);
break;
case source:
GradeCategories gradeCategories = new GradeCategories(options.getMaxExcellentCost(),
options.getMaxAcceptableCost());
report = new SourceReportGenerator(gradeCategories, sourceLoader,
new File("te-report"), costModel, new Date(), options.getWorstOffenderCount(), cfg);
break;
case xml:
XMLSerializer xmlSerializer = new XMLSerializer();
xmlSerializer.setOutputByteStream(out);
OutputFormat format = new OutputFormat();
format.setIndenting(true);
xmlSerializer.setOutputFormat(format);
report = new XMLReportGenerator(xmlSerializer, costModel, options);
break;
case about:
reportModel.setMessageBundle(bundleModel);
reportModel.setSourceLinker(new SourceLinkerModel(linker));
report = new FreemarkerReportGenerator(reportModel, out, "about/Report.html", cfg);
break;
default:
throw new IllegalStateException("Unknown report format " + reportFormat);
}