Class IndentingUTF8XmlOutput

  • All Implemented Interfaces:
    XmlOutput

    public final class IndentingUTF8XmlOutput
    extends UTF8XmlOutput
    UTF8XmlOutput with indentation. TODO: not sure if it's a good idea to move the indenting functionality to another class. Doesn't have to be final, but it helps the JVM.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • IndentingUTF8XmlOutput

        public IndentingUTF8XmlOutput​(java.io.OutputStream out,
                                      java.lang.String indentStr,
                                      Encoded[] localNames,
                                      CharacterEscapeHandler escapeHandler)
        Parameters:
        indentStr - set to null for no indentation and optimal performance. otherwise the string is used for indentation.
    • Method Detail

      • beginStartTag

        public void beginStartTag​(int prefix,
                                  java.lang.String localName)
                           throws java.io.IOException
        Specified by:
        beginStartTag in interface XmlOutput
        Overrides:
        beginStartTag in class UTF8XmlOutput
        Throws:
        java.io.IOException
      • endTag

        public void endTag​(int prefix,
                           java.lang.String localName)
                    throws java.io.IOException
        Specified by:
        endTag in interface XmlOutput
        Overrides:
        endTag in class UTF8XmlOutput
        Throws:
        java.io.IOException
      • text

        public void text​(java.lang.String value,
                         boolean needSP)
                  throws java.io.IOException
        Description copied from interface: XmlOutput
        Writes XML text with character escaping, if necessary.
        Specified by:
        text in interface XmlOutput
        Overrides:
        text in class UTF8XmlOutput
        Parameters:
        value - this string can contain characters that might need escaping (such as '&' or '>')
        Throws:
        java.io.IOException
      • text

        public void text​(Pcdata value,
                         boolean needSP)
                  throws java.io.IOException
        Description copied from interface: XmlOutput
        Writes XML text with character escaping, if necessary.
        Specified by:
        text in interface XmlOutput
        Overrides:
        text in class UTF8XmlOutput
        Parameters:
        value - this string can contain characters that might need escaping (such as '&' or '>')
        Throws:
        java.io.IOException
      • endDocument

        public void endDocument​(boolean fragment)
                         throws java.io.IOException,
                                org.xml.sax.SAXException,
                                javax.xml.stream.XMLStreamException
        Description copied from class: XmlOutputAbstractImpl
        Called at the very end.
        Specified by:
        endDocument in interface XmlOutput
        Overrides:
        endDocument in class UTF8XmlOutput
        Parameters:
        fragment - false if we are writing the whole document.
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.stream.XMLStreamException