Class DefaultDoxia

java.lang.Object
org.apache.maven.doxia.DefaultDoxia
All Implemented Interfaces:
Doxia

@Singleton @Named public class DefaultDoxia extends Object implements Doxia
Simple implementation of the Doxia interface: uses a ParserManager to lookup a parser.
Since:
1.0
  • Field Details

  • Constructor Details

    • DefaultDoxia

      public DefaultDoxia()
  • Method Details

    • parse

      public void parse(Reader source, String parserId, Sink sink) throws ParserNotFoundException, ParseException
      Parses the given source model using a parser with given id, and emits Doxia events into the given sink.
      Specified by:
      parse in interface Doxia
      Parameters:
      source - not null reader that provides the source document
      parserId - identifier for the parser to use
      sink - a sink that consumes the Doxia events
      Throws:
      ParserNotFoundException - if no parser could be found for the given id
      ParseException - if the model could not be parsed
    • parse

      public void parse(Reader source, String parserId, Sink sink, String reference) throws ParserNotFoundException, ParseException
      Parses the given source model using a parser with given id, and emits Doxia events into the given sink.
      Specified by:
      parse in interface Doxia
      Parameters:
      source - not null reader that provides the source document
      parserId - identifier for the parser to use
      sink - a sink that consumes the Doxia events
      reference - string containing the reference to the source (e.g. filename)
      Throws:
      ParserNotFoundException - if no parser could be found for the given id
      ParseException - if the model could not be parsed
    • getParser

      public Parser getParser(String parserId) throws ParserNotFoundException
      Return a parser for the given parserId.
      Specified by:
      getParser in interface Doxia
      Parameters:
      parserId - identifier for the parser to use
      Returns:
      the parser identified by parserId
      Throws:
      ParserNotFoundException - if no parser could be found for the given id