Class SAXDocumentSerializer

    • Field Detail

      • _elementHasNamespaces

        protected boolean _elementHasNamespaces
      • _charactersAsCDATA

        protected boolean _charactersAsCDATA
    • Constructor Detail

      • SAXDocumentSerializer

        protected SAXDocumentSerializer​(boolean v)
      • SAXDocumentSerializer

        public SAXDocumentSerializer()
    • Method Detail

      • startDocument

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

        public final void endDocument()
                               throws org.xml.sax.SAXException
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class org.xml.sax.helpers.DefaultHandler
        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.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • startElement

        public final void startElement​(java.lang.String namespaceURI,
                                       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.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public final void endElement​(java.lang.String namespaceURI,
                                     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.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • characters

        public final 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.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • ignorableWhitespace

        public final 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.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • processingInstruction

        public final 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.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • setDocumentLocator

        public final void setDocumentLocator​(org.xml.sax.Locator locator)
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
        Overrides:
        setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
      • skippedEntity

        public final void skippedEntity​(java.lang.String name)
                                 throws org.xml.sax.SAXException
        Specified by:
        skippedEntity in interface org.xml.sax.ContentHandler
        Overrides:
        skippedEntity in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • comment

        public final void comment​(char[] ch,
                                  int start,
                                  int length)
                           throws org.xml.sax.SAXException
        Specified by:
        comment in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startCDATA

        public final void startCDATA()
                              throws org.xml.sax.SAXException
        Specified by:
        startCDATA in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endCDATA

        public final void endCDATA()
                            throws org.xml.sax.SAXException
        Specified by:
        endCDATA in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startDTD

        public final void startDTD​(java.lang.String name,
                                   java.lang.String publicId,
                                   java.lang.String systemId)
                            throws org.xml.sax.SAXException
        Specified by:
        startDTD in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endDTD

        public final void endDTD()
                          throws org.xml.sax.SAXException
        Specified by:
        endDTD in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • startEntity

        public final void startEntity​(java.lang.String name)
                               throws org.xml.sax.SAXException
        Specified by:
        startEntity in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • endEntity

        public final void endEntity​(java.lang.String name)
                             throws org.xml.sax.SAXException
        Specified by:
        endEntity in interface org.xml.sax.ext.LexicalHandler
        Throws:
        org.xml.sax.SAXException
      • octets

        public final void octets​(java.lang.String URI,
                                 int id,
                                 byte[] b,
                                 int start,
                                 int length)
                          throws org.xml.sax.SAXException
        Description copied from interface: EncodingAlgorithmContentHandler
        Receive notification of encoding algorithm data as an array of byte.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing encoding algorithm data.

        The Parser will call the method of this interface to report each encoding algorithm data. Parsers MUST return all contiguous characters in a single chunk

        Parsers may return all contiguous bytes in a single chunk, or they may split it into several chunks providing that the length of each chunk is of the required length to successfully apply the encoding algorithm to the chunk.

        Specified by:
        octets in interface EncodingAlgorithmContentHandler
        Parameters:
        URI - the URI of the encoding algorithm
        id - the encoding algorithm index
        b - the array of byte
        start - the start position in the array
        length - the number of byte to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
        See Also:
        EncodingAlgorithmIndexes
      • object

        public final void object​(java.lang.String URI,
                                 int id,
                                 java.lang.Object data)
                          throws org.xml.sax.SAXException
        Description copied from interface: EncodingAlgorithmContentHandler
        Receive notification of encoding algorithm data as an object.

        Such notifications will occur for a Fast Infoset SAX parser when processing encoding algorithm data that is converted from an array of byte to an object more suitable for processing.

        Specified by:
        object in interface EncodingAlgorithmContentHandler
        Parameters:
        URI - the URI of the encoding algorithm
        id - the encoding algorithm index
        data - the encoding algorithm object
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
        See Also:
        EncodingAlgorithmIndexes
      • bytes

        public final void bytes​(byte[] b,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of byte.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "base64" encoding algorithm, see subclause 10.3, or the "hexadecimal" encoding algorithm, see subclause 10.2.

        Such a notification may occur for binary data that would normally require base 64 encoding and reported as character data using the characters method

        .

        Specified by:
        bytes in interface PrimitiveTypeContentHandler
        Parameters:
        b - the array of byte
        start - the start position in the array
        length - the number of byte to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • shorts

        public final void shorts​(short[] s,
                                 int start,
                                 int length)
                          throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of short.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "short" encoding algorithm, see subclause 10.4

        .

        Specified by:
        shorts in interface PrimitiveTypeContentHandler
        Parameters:
        s - the array of short
        start - the start position in the array
        length - the number of short to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • ints

        public final void ints​(int[] i,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of int.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "int" encoding algorithm, see subclause 10.5

        .

        Specified by:
        ints in interface PrimitiveTypeContentHandler
        Parameters:
        i - the array of int
        start - the start position in the array
        length - the number of int to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • longs

        public final void longs​(long[] l,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of long.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "long" encoding algorithm, see subclause 10.6

        .

        Specified by:
        longs in interface PrimitiveTypeContentHandler
        Parameters:
        l - the array of long
        start - the start position in the array
        length - the number of long to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • booleans

        public final void booleans​(boolean[] b,
                                   int start,
                                   int length)
                            throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of boolean.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "boolean" encoding algorithm, see subclause 10.7

        .

        Specified by:
        booleans in interface PrimitiveTypeContentHandler
        Parameters:
        b - the array of boolean
        start - the start position in the array
        length - the number of boolean to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • floats

        public final void floats​(float[] f,
                                 int start,
                                 int length)
                          throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of float.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "float" encoding algorithm, see subclause 10.8

        .

        Specified by:
        floats in interface PrimitiveTypeContentHandler
        Parameters:
        f - the array of float
        start - the start position in the array
        length - the number of float to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • doubles

        public final void doubles​(double[] d,
                                  int start,
                                  int length)
                           throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an array of double.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "double" encoding algorithm, see subclause 10.9

        .

        Specified by:
        doubles in interface PrimitiveTypeContentHandler
        Parameters:
        d - the array of double
        start - the start position in the array
        length - the number of double to read from the array
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • uuids

        public void uuids​(long[] msblsb,
                          int start,
                          int length)
                   throws org.xml.sax.SAXException
        Description copied from interface: PrimitiveTypeContentHandler
        Receive notification of character data as an two array of UUID.

        The application must not attempt to read from the array outside of the specified range.

        Such notifications will occur for a Fast Infoset SAX parser when processing data encoded using the "uuid" encoding algorithm, see subclause 10.10

        .

        Specified by:
        uuids in interface PrimitiveTypeContentHandler
        Parameters:
        msblsb - the array of long containing pairs of most signficant bits and least significant bits of the UUIDs
        start - the start position in the array
        length - the number of long to read from the array. This will be twice the number of UUIDs, which are pairs of two long values
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
      • alphabetCharacters

        public void alphabetCharacters​(java.lang.String alphabet,
                                       char[] ch,
                                       int start,
                                       int length)
                                throws org.xml.sax.SAXException
        Specified by:
        alphabetCharacters in interface RestrictedAlphabetContentHandler
        Throws:
        org.xml.sax.SAXException
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length,
                               boolean index)
                        throws org.xml.sax.SAXException
        Description copied from interface: ExtendedContentHandler
        Receive notification of character data.
        Specified by:
        characters in interface ExtendedContentHandler
        Parameters:
        ch - the characters from the XML document
        start - the start position in the array
        length - the number of characters to read from the array
        index - true if the characters are indexed, otherwise false.
        Throws:
        org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
        See Also:
        ContentHandler.characters(char[], int, int)
      • countAttributes

        protected final int countAttributes​(org.xml.sax.Attributes atts)
      • encodeElement

        protected void encodeElement​(java.lang.String namespaceURI,
                                     java.lang.String qName,
                                     java.lang.String localName)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • encodeAttribute

        protected boolean encodeAttribute​(java.lang.String namespaceURI,
                                          java.lang.String qName,
                                          java.lang.String localName)
                                   throws java.io.IOException
        Throws:
        java.io.IOException