Skip navigation links

Package org.apache.maven.doxia.sink

Maven Doxia API.

See: Description

Package org.apache.maven.doxia.sink Description

Maven Doxia API.

The Doxia API is based on Sinks objects: each sink consumes Doxia events to produce a resultant output format (eg Docbook, PDF, XHTML...).

Using Maven Doxia API

The following snippet shows how to use a Doxia Sink:

  File userDir = new FileSystem.getProperty "user.dir" ) );
  File outputFile = new FileuserDir, "test.html" );

  SinkFactory sinkFactory = (SinkFactorylookupSinkFactory.ROLE, "html" )// Plexus lookup
  Sink sink = sinkFactory.createSinkoutputFile.getParentFile(), outputFile.getName() ) );

  // Sink head
  sink.head();

  sink.title();
  sink.text"Title" );
  sink.title_();

  sink.author();
  sink.text"Author" );
  sink.author_();

  sink.date();
  sink.text"Date" );
  sink.date_();

  sink.head_();
  // Sink head

  sink.body();

   sink.paragraph();
   sink.text"Paragraph 1, line 1. Paragraph 1, line 2." );
   sink.paragraph_();

   ...

  sink.body_();

  sink.flush();

  sink.close();

Resources

Skip navigation links

Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.