Class SAXWriter

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

    public class SAXWriter
    extends org.xml.sax.helpers.XMLFilterImpl
    implements java.lang.AutoCloseable
    • Constructor Detail

      • SAXWriter

        public SAXWriter()
      • SAXWriter

        public SAXWriter​(javax.xml.transform.stream.StreamResult streamResult,
                         java.lang.String encoding)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • SAXWriter

        public SAXWriter​(java.io.OutputStream outputStream)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • SAXWriter

        public SAXWriter​(java.io.OutputStream outputStream,
                         java.lang.String encoding)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • SAXWriter

        public SAXWriter​(java.io.Writer writer)
                  throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • reset

        public void reset()
      • setOutput

        public void setOutput​(javax.xml.transform.stream.StreamResult streamResult)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • setOutput

        public void setOutput​(javax.xml.transform.stream.StreamResult streamResult,
                              java.lang.String encoding)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • setOutput

        public void setOutput​(java.io.Writer writer)
      • setOutput

        public void setOutput​(java.io.OutputStream outputStream)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • setOutput

        public void setOutput​(java.io.OutputStream outputStream,
                              java.lang.String encoding)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getOutputWriter

        public java.io.Writer getOutputWriter()
      • flush

        public void flush()
                   throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException
      • close

        public void close()
                   throws org.xml.sax.SAXException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        org.xml.sax.SAXException
      • isEscapeCharacters

        public boolean isEscapeCharacters()
      • setEscapeCharacters

        public void setEscapeCharacters​(boolean escapeCharacters)
      • isWriteReportedNamespaces

        public boolean isWriteReportedNamespaces()
      • setWriteReportedNamespaces

        public void setWriteReportedNamespaces​(boolean writeReportedNamespaces)
      • setPrefix

        public void setPrefix​(java.lang.String prefix,
                              java.lang.String uri)
      • getPrefix

        public java.lang.String getPrefix​(java.lang.String uri)
      • getNamespaceURI

        public java.lang.String getNamespaceURI​(java.lang.String prefix)
      • setDefaultNamespace

        public void setDefaultNamespace​(java.lang.String uri)
      • getIndentString

        public java.lang.String getIndentString()
      • setIndentString

        public void setIndentString​(java.lang.String indent)
      • isWriteEncoding

        public boolean isWriteEncoding()
      • setWriteEncoding

        public void setWriteEncoding​(boolean writeEncoding)
      • isWriteXMLDecl

        public boolean isWriteXMLDecl()
      • setWriteXMLDecl

        public void setWriteXMLDecl​(boolean writeXMLDecl)
      • setHeaderComment

        public void setHeaderComment​(java.lang.String... headerMessage)
      • getHeaderComment

        public java.lang.String[] getHeaderComment()
      • unsetHeaderComment

        public void unsetHeaderComment()
      • setSchemaLocation

        public void setSchemaLocation​(java.lang.String namespaceURI,
                                      java.lang.String schemaLocation)
      • getSchemaLocation

        public java.lang.String getSchemaLocation​(java.lang.String namespaceURI)
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] ch,
                                        int start,
                                        int length)
                                 throws org.xml.sax.SAXException
        Specified by:
        ignorableWhitespace in interface org.xml.sax.ContentHandler
        Overrides:
        ignorableWhitespace in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.String data)
                                   throws org.xml.sax.SAXException
        Specified by:
        processingInstruction in interface org.xml.sax.ContentHandler
        Overrides:
        processingInstruction in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Overrides:
        startDocument in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes atts)
                          throws org.xml.sax.SAXException
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.SAXException
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        startPrefixMapping in class org.xml.sax.helpers.XMLFilterImpl
        Throws:
        org.xml.sax.SAXException
      • writeSchemaLocations

        public void writeSchemaLocations()
                                  throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException
      • writeHeader

        public void writeHeader​(java.lang.String... data)
                         throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException