Class XMLWriterImpl

    • Constructor Detail

      • XMLWriterImpl

        public XMLWriterImpl()
    • Method Detail

      • setEncoding

        public void setEncoding​(String pEncoding)
        Description copied from interface: XMLWriter
        Sets the writers encoding.
        Specified by:
        setEncoding in interface XMLWriter
        Parameters:
        pEncoding - Writers encoding, by default null, in which case UTF-8 is being used.
      • getEncoding

        public String getEncoding()
        Description copied from interface: XMLWriter
        Returns the writers encoding.
        Specified by:
        getEncoding in interface XMLWriter
        Returns:
        Writers encoding, by default null, in which case UTF-8 is being used.
      • setDeclarating

        public void setDeclarating​(boolean pDeclarating)
        Description copied from interface: XMLWriter
        Sets, whether an XML declaration is being generated.
        Specified by:
        setDeclarating in interface XMLWriter
        Parameters:
        pDeclarating - Whether an XML declaration is generated. Defaults to false.
      • isDeclarating

        public boolean isDeclarating()
        Description copied from interface: XMLWriter
        Returns, whether an XML declaration is being generated.
        Specified by:
        isDeclarating in interface XMLWriter
        Returns:
        Whether an XML declaration is generated. Defaults to false.
      • setIndentString

        public void setIndentString​(String pIndentString)
        Description copied from interface: XMLWriter
        Sets the string being used to indent an XML element by one level. Ignored, if indentation is disabled.
        Specified by:
        setIndentString in interface XMLWriter
        Parameters:
        pIndentString - The indentation string, by default " " (two blanks).
      • getIndentString

        public String getIndentString()
        Description copied from interface: XMLWriter
        Returns the string being used to indent an XML element by one level. Ignored, if indentation is disabled.
        Specified by:
        getIndentString in interface XMLWriter
        Returns:
        The indentation string, by default " " (two blanks).
      • setLineFeed

        public void setLineFeed​(String pLineFeed)
        Description copied from interface: XMLWriter
        Sets the line terminator. Ignored, if indentation is disabled.
        Specified by:
        setLineFeed in interface XMLWriter
        Parameters:
        pLineFeed - The line terminator, by default "\n" (Line Feed). You might prefer "\r\n" (Carriage Return, Line Feed), which is the default on Windows and related operating systems.
      • getLineFeed

        public String getLineFeed()
        Description copied from interface: XMLWriter
        Returns the line terminator. Ignored, if indentation is disabled.
        Specified by:
        getLineFeed in interface XMLWriter
        Returns:
        The line terminator, by default "\n" (Line Feed). You might prefer "\r\n" (Carriage Return, Line Feed), which is the default on Windows and related operating systems.
      • setFlushing

        public void setFlushing​(boolean pFlushing)
        Description copied from interface: XMLWriter
        Sets, whether the method ContentHandler.endDocument() should do a flush on the target stream.
        Specified by:
        setFlushing in interface XMLWriter
        Parameters:
        pFlushing - True, if a flush should be done. Defaults to false.
      • isFlushing

        public boolean isFlushing()
        Description copied from interface: XMLWriter
        Returns, whether the method ContentHandler.endDocument() should do a flush on the target stream.
        Specified by:
        isFlushing in interface XMLWriter
        Returns:
        True, if a flush should be done. Defaults to false.
      • setWriter

        public void setWriter​(Writer pWriter)

        Sets the JaxbXMLSerializers Writer.

        Specified by:
        setWriter in interface XMLWriter
        Parameters:
        pWriter - The target writer.
      • getWriter

        public Writer getWriter()

        Returns the JaxbXMLSerializers Writer.

        Specified by:
        getWriter in interface XMLWriter
        Returns:
        The target writer.
      • startPrefixMapping

        public void startPrefixMapping​(String prefix,
                                       String namespaceURI)
                                throws SAXException

        Starts use of a namespace prefix.

        Specified by:
        startPrefixMapping in interface ContentHandler
        Parameters:
        namespaceURI - The namespace URI
        prefix - The prefix
        Throws:
        SAXException - Not actually thrown, just for compliance to the interface specification.
      • endPrefixMapping

        public void endPrefixMapping​(String prefix)
                              throws SAXException

        Terminates use of a namespace prefix.

        Specified by:
        endPrefixMapping in interface ContentHandler
        Parameters:
        prefix - The prefix being abandoned.
        Throws:
        SAXException - Not actually thrown, just for compliance to the interface specification.
      • endDocument

        public void endDocument()
                         throws SAXException

        This method finishs the handlers action. After calling endDocument you may start a new action by calling startDocument again.

        Specified by:
        endDocument in interface ContentHandler
        Throws:
        SAXException - Not actually thrown, just for compliance to the interface specification.
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] ch,
                                        int start,
                                        int length)
                                 throws SAXException
        Calls the character method with the same arguments.
        Specified by:
        ignorableWhitespace in interface ContentHandler
        Parameters:
        ch - A string of whitespace characters being inserted into the document.
        start - The index of the first character.
        length - The number of characters.
        Throws:
        SAXException - Thrown in case of an IOException.
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws SAXException
        Inserts a string of characters into the document.
        Specified by:
        characters in interface ContentHandler
        Parameters:
        ch - The characters being inserted. A substring, to be precise.
        start - Index of the first character
        length - Number of characters being inserted
        Throws:
        SAXException - Thrown in case of an IOException
      • canEncode

        public boolean canEncode​(char c)
        Description copied from interface: XMLWriter

        Returns whether the XMLWriter can encode the character c without an escape sequence like &#ddd;.

        Specified by:
        canEncode in interface XMLWriter
        Parameters:
        c - The character being checked for escaping.
        Returns:
        Whether to encode the character.
      • endElement

        public void endElement​(String namespaceURI,
                               String localName,
                               String qName)
                        throws SAXException

        Terminates an element.

        Specified by:
        endElement in interface ContentHandler
        Parameters:
        namespaceURI - The namespace URI, if any, or null
        localName - The local name, without prefix, or null
        qName - The qualified name, including a prefix, or null
        Throws:
        SAXException - Thrown in case of an IOException.
      • startElement

        public void startElement​(String namespaceURI,
                                 String localName,
                                 String qName,
                                 Attributes attr)
                          throws SAXException
        Starts a new element.
        Specified by:
        startElement in interface ContentHandler
        Parameters:
        namespaceURI - The namespace URI, if any, or null
        localName - The local name, without prefix, or null
        qName - The qualified name, including a prefix, or null
        attr - The element attributes
        Throws:
        SAXException - Thrown in case of an IOException.
      • skippedEntity

        public void skippedEntity​(String ent)
                           throws SAXException
        Not actually implemented, because I don't know how to skip entities.
        Specified by:
        skippedEntity in interface ContentHandler
        Parameters:
        ent - The entity being skipped.
        Throws:
        SAXException - Not actually thrown, just for compliance to the interface specification.