org.jvnet.fastinfoset.sax.helpers
Class FastInfosetDefaultHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.jvnet.fastinfoset.sax.helpers.FastInfosetDefaultHandler
All Implemented Interfaces:
EncodingAlgorithmContentHandler, PrimitiveTypeContentHandler, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler

public class FastInfosetDefaultHandler
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ext.LexicalHandler, EncodingAlgorithmContentHandler, PrimitiveTypeContentHandler

Default base class for SAX event handlers of a FastInfosetReader.

This class is available as a convenience for applications: it provides default implementations for all of the callbacks of the following:

Application writers can extend this class when they need to implement only part of an interface; parser writers can instantiate this class to provide default handlers when the application has not supplied its own.


Constructor Summary
FastInfosetDefaultHandler()
           
 
Method Summary
 void booleans(boolean[] b, int start, int length)
          Receive notification of character data as an array of boolean.
 void bytes(byte[] b, int start, int length)
          Receive notification of character data as an array of byte.
 void comment(char[] ch, int start, int length)
           
 void doubles(double[] d, int start, int length)
          Receive notification of character data as an array of double.
 void endCDATA()
           
 void endDTD()
           
 void endEntity(java.lang.String name)
           
 void floats(float[] f, int start, int length)
          Receive notification of character data as an array of float.
 void ints(int[] i, int start, int length)
          Receive notification of character data as an array of int.
 void longs(long[] l, int start, int length)
          Receive notification of character data as an array of long.
 void object(java.lang.String URI, int algorithm, java.lang.Object o)
          Receive notification of encoding algorithm data as an object.
 void octets(java.lang.String URI, int algorithm, byte[] b, int start, int length)
          Receive notification of encoding algorithm data as an array of byte.
 void shorts(short[] s, int start, int length)
          Receive notification of character data as an array of short.
 void startCDATA()
           
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
           
 void startEntity(java.lang.String name)
           
 void uuids(long[] msblsb, int start, int length)
          Receive notification of character data as an two array of UUID.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastInfosetDefaultHandler

public FastInfosetDefaultHandler()
Method Detail

comment

public 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 void startCDATA()
                throws org.xml.sax.SAXException
Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

endCDATA

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

startDTD

public 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 void endDTD()
            throws org.xml.sax.SAXException
Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

startEntity

public 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 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 void octets(java.lang.String URI,
                   int algorithm,
                   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
algorithm - 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 void object(java.lang.String URI,
                   int algorithm,
                   java.lang.Object o)
            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
algorithm - the encoding algorithm index
o - the encoding algorithm object
Throws:
org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception
See Also:
EncodingAlgorithmIndexes

booleans

public 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

bytes

public 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 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 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 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

floats

public 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 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