本文整理汇总了Java中org.apache.maven.doxia.sink.Sink.close方法的典型用法代码示例。如果您正苦于以下问题:Java Sink.close方法的具体用法?Java Sink.close怎么用?Java Sink.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.doxia.sink.Sink
的用法示例。
在下文中一共展示了Sink.close方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeReport
import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
@Override
protected void executeReport(Locale arg0) throws MavenReportException {
if (canGenerateReport()) {
final Sink sink = getSink();
log.debug("starting report....................");
final ObjectMapper mapper = new ObjectMapper();
documentRestEndpoints(sink, mapper);
documentTransferClasses(sink, mapper);
log.debug("Closing up report....................");
sink.flush();
sink.close();
}
}
示例2: createReport
import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
private void createReport(String reportName, Locale locale, Document document) throws IOException {
SinkFactory factory = getSinkFactory();
Sink sink = factory.createSink(getReportOutputDirectory(), reportName);
sinkBeginReport(sink, getBundle( locale ));
sink.rawText(document.html());
//addElements(sink, document.head().getElementsByTag("link"));
//addElements(sink, document.head().getElementsByTag("script"));
//addElements(sink, document.body().children());
sinkEndReport(sink);
sink.close();
}
示例3: parse
import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
@Override
public void parse(final @Nullable Reader reader, final @Nullable Sink sink) throws ParseException {
final String markupContent = readMarkupContent(Nullsafe.nullsafe(reader));
final String htmlContent = parseToHtml(markupContent);
final Sink nullsafeSink = Nullsafe.nullsafe(sink);
nullsafeSink.rawText(htmlContent);
nullsafeSink.flush();
nullsafeSink.close();
}
示例4: sinkEndReport
import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
private void sinkEndReport( Sink sink ) {
sink.section1_();
sink.body_();
sink.flush();
sink.close();
}
示例5: doGenerateReport
import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
public void doGenerateReport( ResourceBundle bundle, Sink sink, JDependXMLReportParser jdepend )
{
this.jdepend = jdepend;
sink.head();
sink.title();
sink.text( bundle.getString( "report.title" ) ); //$NON-NLS-1$
sink.title_();
sink.head_();
sink.body();
sink.section1();
sink.sectionTitle1();
sink.text( bundle.getString( "report.metricresults" ) ); //$NON-NLS-1$
sink.sectionTitle1_();
doSectionLinks( bundle, sink );
sink.lineBreak();
sink.lineBreak();
sink.text( bundle.getString( "report.intro" ) ); //$NON-NLS-1$
sink.lineBreak();
sink.lineBreak();
doSummarySection( bundle, sink );
doPackagesSection( bundle, sink );
doCycleSection( bundle, sink );
doExplanationSection( bundle, sink );
sink.section1_();
sink.body_();
sink.flush();
sink.close();
}
示例6: executeReport
import org.apache.maven.doxia.sink.Sink; //导入方法依赖的package包/类
/**
* Run the actual report.
*
* @param locale
* The locale to use for this report.
* @throws MavenReportException
* If the report generation failed.
*/
@Override
public void executeReport (final Locale locale) throws MavenReportException
{
final Sink sink = getSink ();
createReportHeader (getBundle (locale), sink);
final File [] sourceDirs = getSourceDirectories ();
for (final File sourceDir : sourceDirs)
{
final GrammarInfo [] grammarInfos = scanForGrammars (sourceDir);
if (grammarInfos == null)
{
getLog ().debug ("Skipping non-existing source directory: " + sourceDir);
}
else
{
Arrays.sort (grammarInfos, GrammarInfoComparator.getInstance ());
for (final GrammarInfo grammarInfo : grammarInfos)
{
final File grammarFile = grammarInfo.getGrammarFile ();
String relativeOutputFileName = grammarInfo.getRelativeGrammarFile ();
relativeOutputFileName = relativeOutputFileName.replaceAll ("(?i)\\.(jj|jjt|jtb)$",
getOutputFileExtension ());
final File jjdocOutputFile = new File (getJJDocOutputDirectory (), relativeOutputFileName);
final JJDoc jjdoc = newJJDoc ();
jjdoc.setInputFile (grammarFile);
jjdoc.setOutputFile (jjdocOutputFile);
try
{
jjdoc.run ();
}
catch (final Exception e)
{
throw new MavenReportException ("Failed to create BNF documentation: " + grammarFile, e);
}
createReportLink (sink, sourceDir, grammarFile, relativeOutputFileName);
}
}
}
createReportFooter (sink);
sink.flush ();
sink.close ();
}