Class XmlOutputStream

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    AsyncXmlOutputStream

    public class XmlOutputStream
    extends java.lang.Object
    implements java.lang.AutoCloseable
    This is a minimal XML output stream, that can be used to write XML.
    Since:
    1.0 Nov 30, 2005
    Version:
    1.0
    Author:
    http://cheenath.com
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlOutputStream​(java.io.OutputStream out, boolean prettyPrint)  
      XmlOutputStream​(java.io.OutputStream out, java.lang.String prettyPrintIndentation)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void endDocument()  
      void flush()  
      java.lang.String getPrefix​(java.lang.String namespace)  
      java.io.Writer getWriter()  
      void setPrefix​(java.lang.String prefix, java.lang.String namespace)  
      void startDocument()  
      void writeAttribute​(java.lang.String namespace, java.lang.String name, java.lang.String value)  
      void writeComment​(java.lang.String text)  
      void writeEndTag​(java.lang.String namespace, java.lang.String name)  
      void writeStartTag​(java.lang.String namespace, java.lang.String name)  
      void writeStringElement​(java.lang.String namespace, java.lang.String name, java.lang.String content)  
      void writeText​(java.lang.String text)  
      • Methods inherited from class java.lang.Object

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

      • XmlOutputStream

        public XmlOutputStream​(java.io.OutputStream out,
                               boolean prettyPrint)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • XmlOutputStream

        public XmlOutputStream​(java.io.OutputStream out,
                               java.lang.String prettyPrintIndentation)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getPrefix

        public java.lang.String getPrefix​(java.lang.String namespace)
      • startDocument

        public void startDocument()
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • endDocument

        public void endDocument()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • setPrefix

        public void setPrefix​(java.lang.String prefix,
                              java.lang.String namespace)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeStartTag

        public void writeStartTag​(java.lang.String namespace,
                                  java.lang.String name)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEndTag

        public void writeEndTag​(java.lang.String namespace,
                                java.lang.String name)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeStringElement

        public void writeStringElement​(java.lang.String namespace,
                                       java.lang.String name,
                                       java.lang.String content)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • writeAttribute

        public void writeAttribute​(java.lang.String namespace,
                                   java.lang.String name,
                                   java.lang.String value)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeText

        public void writeText​(java.lang.String text)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeComment

        public void writeComment​(java.lang.String text)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getWriter

        public java.io.Writer getWriter()
      • flush

        public void flush()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException