Class ParserListenerWriter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Triggered when parsing is finished and the stream will be closed.
      void comment​(java.lang.String comment)
      Triggered for comments that are found.
      void endElement​(java.lang.String curentTag, java.lang.String ns)
      Triggered on a closing tag.
      void init()
      Triggered when parsing has started.
      void startElement​(java.lang.String currentTag, java.util.Map<java.lang.String,​java.lang.String> attributes, java.lang.String ns)
      Triggered on an opening tag.
      void text​(java.lang.String text)
      Called when text is encountered.
      void unknownText​(java.lang.String string)
      Triggered for text found outside root tag.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • formatted

        private final boolean formatted
    • Constructor Detail

      • ParserListenerWriter

        public ParserListenerWriter​(Appender writer,
                                    boolean formatted)
        Parameters:
        writer - the appender
        formatted - true if output should be formatted
      • ParserListenerWriter

        public ParserListenerWriter​(Appender writer)
        Construct a new ParserListenerWriter with the given appender and default formatted to true;
        Parameters:
        writer - the appender
    • Method Detail

      • unknownText

        public void unknownText​(java.lang.String string)
        Description copied from interface: XMLParserListener
        Triggered for text found outside root tag.
        Specified by:
        unknownText in interface XMLParserListener
        Parameters:
        string - the text
      • startElement

        public void startElement​(java.lang.String currentTag,
                                 java.util.Map<java.lang.String,​java.lang.String> attributes,
                                 java.lang.String ns)
        Description copied from interface: XMLParserListener
        Triggered on an opening tag.
        Specified by:
        startElement in interface XMLParserListener
        Parameters:
        currentTag - the tag of the element
        attributes - the attributes found on the tag
        ns - the namespace or empty String
      • endElement

        public void endElement​(java.lang.String curentTag,
                               java.lang.String ns)
        Description copied from interface: XMLParserListener
        Triggered on a closing tag.
        Specified by:
        endElement in interface XMLParserListener
        Parameters:
        curentTag - the tag
        ns - the namespace or empty String
      • comment

        public void comment​(java.lang.String comment)
        Description copied from interface: XMLParserListener
        Triggered for comments that are found.
        Specified by:
        comment in interface XMLParserListener
        Parameters:
        comment - the comment
      • close

        public void close()
        Description copied from interface: XMLParserListener
        Triggered when parsing is finished and the stream will be closed.
        Specified by:
        close in interface XMLParserListener
      • text

        public void text​(java.lang.String text)
        Description copied from interface: XMLParserListener
        Called when text is encountered.
        Specified by:
        text in interface XMLParserListener
        Parameters:
        text - the text