本文整理匯總了Java中com.buschmais.jqassistant.core.report.api.ReportTransformer類的典型用法代碼示例。如果您正苦於以下問題:Java ReportTransformer類的具體用法?Java ReportTransformer怎麽用?Java ReportTransformer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ReportTransformer類屬於com.buschmais.jqassistant.core.report.api包,在下文中一共展示了ReportTransformer類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: executeReport
import com.buschmais.jqassistant.core.report.api.ReportTransformer; //導入依賴的package包/類
@Override
protected void executeReport(Locale locale) throws MavenReportException {
File selectedXmlReportFile;
if (xmlReportFile != null) {
selectedXmlReportFile = xmlReportFile;
} else {
selectedXmlReportFile = new File(project.getBuild().getDirectory() + "/" + ProjectResolver.OUTPUT_DIRECTORY + "/" + AbstractMojo.REPORT_XML);
}
if (selectedXmlReportFile.exists()) {
StringWriter writer = new StringWriter();
// Transform
Source xmlSource = new StreamSource(selectedXmlReportFile);
Result htmlTarget = new StreamResult(writer);
getLog().info("Transforming " + selectedXmlReportFile.getAbsolutePath() + ".");
ReportTransformer transformer = new HtmlReportTransformer();
try {
transformer.toEmbedded(xmlSource, htmlTarget);
} catch (ReportTransformerException e) {
throw new MavenReportException("Cannot transform report.", e);
}
getSink().rawText(writer.toString());
}
}