Class Xhtml5Parser

All Implemented Interfaces:
MacroExecutor, HtmlMarkup, Markup, XmlMarkup, Xhtml5Markup, Parser
Direct Known Subclasses:
MarkdownParser.MarkdownHtmlParser

@Singleton @Named("xhtml") public class Xhtml5Parser extends Xhtml5BaseParser implements Xhtml5Markup
Parse an xhtml5 model and emit events into a Doxia Sink.
  • Field Details

    • source

      protected boolean source
      For verbatim source.
  • Constructor Details

  • Method Details

    • handleStartTag

      protected void handleStartTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, MacroExecutionException
      Description copied from class: Xhtml5BaseParser
      Goes through the possible start tags. Just calls Xhtml5BaseParser.baseStartTag(XmlPullParser,Sink), this should be overridden by implementing parsers to include additional tags.
      Overrides:
      handleStartTag in class Xhtml5BaseParser
      Parameters:
      parser - A parser, not null.
      sink - the sink to receive the events.
      Throws:
      org.codehaus.plexus.util.xml.pull.XmlPullParserException - if there's a problem parsing the model
      MacroExecutionException - if there's a problem executing a macro
    • handleEndTag

      protected void handleEndTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, MacroExecutionException
      Description copied from class: Xhtml5BaseParser
      Goes through the possible end tags. Just calls Xhtml5BaseParser.baseEndTag(XmlPullParser,Sink), this should be overridden by implementing parsers to include additional tags.
      Overrides:
      handleEndTag in class Xhtml5BaseParser
      Parameters:
      parser - A parser, not null.
      sink - the sink to receive the events.
      Throws:
      org.codehaus.plexus.util.xml.pull.XmlPullParserException - if there's a problem parsing the model
      MacroExecutionException - if there's a problem executing a macro
    • handleComment

      protected void handleComment(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException
      Description copied from class: AbstractXmlParser
      Handles comments.

      This is a default implementation, all data are emitted as comment events into the specified sink.

      Overrides:
      handleComment in class Xhtml5BaseParser
      Parameters:
      parser - A parser, not null.
      sink - the sink to receive the events. Not null.
      Throws:
      org.codehaus.plexus.util.xml.pull.XmlPullParserException - if there's a problem parsing the model
    • init

      protected void init()
      Initialize the parser. This is called first by AbstractParser.parse(java.io.Reader, org.apache.maven.doxia.sink.Sink) and can be used to set the parser into a clear state so it can be re-used.
      Overrides:
      init in class Xhtml5BaseParser
    • parse

      public void parse(Reader source, Sink sink, String reference) throws ParseException
      Description copied from interface: Parser
      Parses the given source model and emits Doxia events into the given sink.
      Specified by:
      parse in interface Parser
      Overrides:
      parse in class Xhtml5BaseParser
      Parameters:
      source - not null reader that provides the source document.
      sink - A sink that consumes the Doxia events.
      reference - a string identifying the source (for file based documents the source file path)
      Throws:
      ParseException - if the model could not be parsed.