Class XhtmlParser

    • Constructor Detail

      • XhtmlParser

        public XhtmlParser()
    • Method Detail

      • handleStartTag

        protected void handleStartTag​(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
                                      Sink sink)
                               throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
                                      MacroExecutionException
        Goes through the possible start tags. Just calls XhtmlBaseParser.baseStartTag(XmlPullParser,Sink), this should be overridden by implementing parsers to include additional tags.
        Overrides:
        handleStartTag in class XhtmlBaseParser
        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
        Goes through the possible end tags. Just calls XhtmlBaseParser.baseEndTag(XmlPullParser,Sink), this should be overridden by implementing parsers to include additional tags.
        Overrides:
        handleEndTag in class XhtmlBaseParser
        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
        Handles comments.

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

        Overrides:
        handleComment in class XhtmlBaseParser
        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
      • parse

        public void parse​(java.io.Reader source,
                          Sink sink)
                   throws ParseException
        Parses the given source model and emits Doxia events into the given sink.
        Specified by:
        parse in interface Parser
        Overrides:
        parse in class XhtmlBaseParser
        Parameters:
        source - not null reader that provides the source document. You could use newReader methods from ReaderFactory.
        sink - A sink that consumes the Doxia events.
        Throws:
        ParseException - if the model could not be parsed.