Top Description Methods
org.jvnet.fastinfoset.sax

public Interface PrimitiveTypeContentHandler

Known Direct Subinterfaces
org.jvnet.fastinfoset.sax.FastInfosetWriter
Known Direct Implementers
org.jvnet.fastinfoset.sax.helpers.FastInfosetDefaultHandler
Imports
org.xml.sax.SAXException

SAX2 extention handler to receive notification of character data as primtive types.

This is an optional extension handler for SAX2. XML readers are not required to recognize this handler, and it is not part of core-only SAX2 distributions.

This interface may be used with with a Fast Infoset SAX parser to receive notification of data encoded using the following built-in encoding algorithms specified in ITU-T Rec. X.891 | ISO/IEC 24824-1 (Fast Infoset), clause 10: "boolean", "base64", "short", "int", "long", "float", "double" and "uuid" encoding algorithms.

To set the PrimitiveTypeContentHandler for an XML reader, use the setProperty method with the property name URI TO BE DEFINED and an object implementing this interface (or null) as the value. If the reader does not report primitive data types, it will throw a SAXNotRecognizedException

To set the PrimitiveTypeContentHandler for an Fast Infoset reader, use setPrimitiveTypeContentHandler method.

The Parser will call methods of this interface to report each chunk of character data that has been converted to an array of primitive types, for example an array of integer or an array of float. Parsers may return all contiguous primtive types in a single chunk, or they may split it into several chunks

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

See Also
org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler, org.jvnet.fastinfoset.sax.FastInfosetReader, org.xml.sax.XMLReader

Method Summary

Modifier and TypeMethod and Description
public void
booleans(boolean[]
the array of boolean
b
,
int
the start position in the array
start
,
int
the number of boolean to read from the array
length
)

Receive notification of character data as an array of boolean.

public void
bytes(byte[]
the array of byte
b
,
int
the start position in the array
start
,
int
the number of byte to read from the array
length
)

Receive notification of character data as an array of byte.

public void
doubles(double[]
the array of double
d
,
int
the start position in the array
start
,
int
the number of double to read from the array
length
)

Receive notification of character data as an array of double.

public void
floats(float[]
the array of float
f
,
int
the start position in the array
start
,
int
the number of float to read from the array
length
)

Receive notification of character data as an array of float.

public void
ints(int[]
the array of int
i
,
int
the start position in the array
start
,
int
the number of int to read from the array
length
)

Receive notification of character data as an array of int.

public void
longs(long[]
the array of long
l
,
int
the start position in the array
start
,
int
the number of long to read from the array
length
)

Receive notification of character data as an array of long.

public void
shorts(short[]
the array of short
s
,
int
the start position in the array
start
,
int
the number of short to read from the array
length
)

Receive notification of character data as an array of short.

public void
uuids(long[]
the array of long containing pairs of most signficant bits and least significant bits of the UUIDs
msblsb
,
int
the start position in the array
start
,
int
the number of long to read from the array. This will be twice the number of UUIDs, which are pairs of two long values
length
)

Receive notification of character data as an two array of UUID.

Method Detail

booleansback to summary
public void booleans(boolean[] b, int start, int length) throws SAXException

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

.

Parameters
b:boolean[]

the array of boolean

start:int

the start position in the array

length:int

the number of boolean to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
bytesback to summary
public void bytes(byte[] b, int start, int length) throws SAXException

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

.

Parameters
b:byte[]

the array of byte

start:int

the start position in the array

length:int

the number of byte to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
doublesback to summary
public void doubles(double[] d, int start, int length) throws SAXException

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

.

Parameters
d:double[]

the array of double

start:int

the start position in the array

length:int

the number of double to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
floatsback to summary
public void floats(float[] f, int start, int length) throws SAXException

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

.

Parameters
f:float[]

the array of float

start:int

the start position in the array

length:int

the number of float to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
intsback to summary
public void ints(int[] i, int start, int length) throws SAXException

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

.

Parameters
i:int[]

the array of int

start:int

the start position in the array

length:int

the number of int to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
longsback to summary
public void longs(long[] l, int start, int length) throws SAXException

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

.

Parameters
l:long[]

the array of long

start:int

the start position in the array

length:int

the number of long to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
shortsback to summary
public void shorts(short[] s, int start, int length) throws SAXException

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

.

Parameters
s:short[]

the array of short

start:int

the start position in the array

length:int

the number of short to read from the array

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
uuidsback to summary
public void uuids(long[] msblsb, int start, int length) throws SAXException

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

.

Parameters
msblsb:long[]

the array of long containing pairs of most signficant bits and least significant bits of the UUIDs

start:int

the start position in the array

length:int

the number of long to read from the array. This will be twice the number of UUIDs, which are pairs of two long values

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception