Class XmlWriter

  • All Implemented Interfaces:
    XMLConstants, CSSConstants, SVGConstants

    class XmlWriter
    extends java.lang.Object
    implements SVGConstants
    Writes a Node as text output. Package access. This is *not* a full Xml printout implementation. It only covers what is needed by the Graphics2D class. The code for this class draws heavily from the work done for Sun's Project X by David Brownell.
    Version:
    $Id: XmlWriter.java 1808001 2017-09-11 09:51:29Z ssteiner $
    • Field Detail

      • EOL

        private static java.lang.String EOL
      • SPACES

        private static final char[] SPACES
      • SPACES_LEN

        private static final int SPACES_LEN
    • Constructor Detail

      • XmlWriter

        XmlWriter()
    • Method Detail

      • writeXml

        private static void writeXml​(org.w3c.dom.Attr attr,
                                     XmlWriter.IndentWriter out,
                                     boolean escaped)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeChildrenXml

        private static void writeChildrenXml​(org.w3c.dom.Attr attr,
                                             XmlWriter.IndentWriter out,
                                             boolean escaped)
                                      throws java.io.IOException
        Writes the attribute's value.
        Throws:
        java.io.IOException
      • writeXml

        private static void writeXml​(org.w3c.dom.Comment comment,
                                     XmlWriter.IndentWriter out,
                                     boolean escaped)
                              throws java.io.IOException
        Writes out the comment. Note that spaces may be added to prevent illegal comments: between consecutive dashes ("--") or if the last character of the comment is a dash.
        Throws:
        java.io.IOException
      • writeXml

        private static void writeXml​(org.w3c.dom.Text text,
                                     XmlWriter.IndentWriter out,
                                     boolean escaped)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeXml

        private static void writeXml​(org.w3c.dom.Text text,
                                     XmlWriter.IndentWriter out,
                                     boolean trimWS,
                                     boolean escaped)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeXml

        private static void writeXml​(org.w3c.dom.CDATASection cdataSection,
                                     XmlWriter.IndentWriter out,
                                     boolean escaped)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDocumentHeader

        private static void writeDocumentHeader​(XmlWriter.IndentWriter out)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • java2std

        static java.lang.String java2std​(java.lang.String encodingName)