|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.sun.xml.fastinfoset.Encoder
com.sun.xml.fastinfoset.sax.SAXDocumentSerializer
public class SAXDocumentSerializer
The Fast Infoset SAX serializer.
Instantiate this serializer to serialize a fast infoset document in accordance with the SAX API.
This utilizes the SAX API in a reverse manner to that of parsing. It is the responsibility of the client to call the appropriate event methods on the SAX handlers, and to ensure that such a sequence of methods calls results in the production well-formed fast infoset documents. The SAXDocumentSerializer performs no well-formed checks.
More than one fast infoset document may be encoded to the
OutputStream.
| Field Summary | |
|---|---|
protected boolean |
_charactersAsCDATA
|
protected boolean |
_elementHasNamespaces
|
| Constructor Summary | |
|---|---|
|
SAXDocumentSerializer()
|
protected |
SAXDocumentSerializer(boolean v)
|
| Method Summary | |
|---|---|
void |
alphabetCharacters(String alphabet,
char[] ch,
int start,
int length)
|
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 |
characters(char[] ch,
int start,
int length)
|
void |
characters(char[] ch,
int start,
int length,
boolean index)
Receive notification of character data. |
void |
comment(char[] ch,
int start,
int length)
|
protected int |
countAttributes(Attributes atts)
|
void |
dateTimeCharacters(char[] ch,
int start,
int length)
|
void |
doubles(double[] d,
int start,
int length)
Receive notification of character data as an array of double. |
protected boolean |
encodeAttribute(String namespaceURI,
String qName,
String localName)
|
protected void |
encodeAttributes(Attributes atts)
|
protected void |
encodeElement(String namespaceURI,
String qName,
String localName)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String namespaceURI,
String localName,
String qName)
|
void |
endEntity(String name)
|
void |
floats(float[] f,
int start,
int length)
Receive notification of character data as an array of float. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
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 |
numericCharacters(char[] ch,
int start,
int length)
|
void |
object(String URI,
int id,
Object data)
Receive notification of encoding algorithm data as an object. |
void |
octets(String URI,
int id,
byte[] b,
int start,
int length)
Receive notification of encoding algorithm data as an array of byte. |
void |
processingInstruction(String target,
String data)
|
void |
reset()
Reset the encoder for reuse encoding another XML infoset. |
void |
setDocumentLocator(Locator locator)
|
void |
shorts(short[] s,
int start,
int length)
Receive notification of character data as an array of short. |
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String systemId)
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
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 |
|---|
endPrefixMapping, error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
|---|
endPrefixMapping |
| Field Detail |
|---|
protected boolean _elementHasNamespaces
protected boolean _charactersAsCDATA
| Constructor Detail |
|---|
protected SAXDocumentSerializer(boolean v)
public SAXDocumentSerializer()
| Method Detail |
|---|
public void reset()
Encoder
reset in interface FastInfosetSerializerreset in class Encoder
public final void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerSAXException
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void processingInstruction(String target,
String data)
throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic final void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class org.xml.sax.helpers.DefaultHandler
public final void skippedEntity(String name)
throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class org.xml.sax.helpers.DefaultHandlerSAXException
public final void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXException
public final void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXException
public final void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXException
public final void startDTD(String name,
String publicId,
String systemId)
throws SAXException
startDTD in interface LexicalHandlerSAXException
public final void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXException
public final void startEntity(String name)
throws SAXException
startEntity in interface LexicalHandlerSAXException
public final void endEntity(String name)
throws SAXException
endEntity in interface LexicalHandlerSAXException
public final void octets(String URI,
int id,
byte[] b,
int start,
int length)
throws SAXException
EncodingAlgorithmContentHandlerThe 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.
octets in interface EncodingAlgorithmContentHandlerURI - the URI of the encoding algorithmid - the encoding algorithm indexb - the array of bytestart - the start position in the arraylength - the number of byte to read from the array
SAXException - any SAX exception, possibly
wrapping another exceptionEncodingAlgorithmIndexes
public final void object(String URI,
int id,
Object data)
throws SAXException
EncodingAlgorithmContentHandlerSuch 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.
object in interface EncodingAlgorithmContentHandlerURI - the URI of the encoding algorithmid - the encoding algorithm indexdata - the encoding algorithm object
SAXException - any SAX exception, possibly
wrapping another exceptionEncodingAlgorithmIndexes
public final void bytes(byte[] b,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
bytes in interface PrimitiveTypeContentHandlerb - the array of bytestart - the start position in the arraylength - the number of byte to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public final void shorts(short[] s,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
shorts in interface PrimitiveTypeContentHandlers - the array of shortstart - the start position in the arraylength - the number of short to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public final void ints(int[] i,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
ints in interface PrimitiveTypeContentHandleri - the array of intstart - the start position in the arraylength - the number of int to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public final void longs(long[] l,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
longs in interface PrimitiveTypeContentHandlerl - the array of longstart - the start position in the arraylength - the number of long to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public final void booleans(boolean[] b,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
booleans in interface PrimitiveTypeContentHandlerb - the array of booleanstart - the start position in the arraylength - the number of boolean to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public final void floats(float[] f,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
floats in interface PrimitiveTypeContentHandlerf - the array of floatstart - the start position in the arraylength - the number of float to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public final void doubles(double[] d,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
doubles in interface PrimitiveTypeContentHandlerd - the array of doublestart - the start position in the arraylength - the number of double to read from the array
SAXException - any SAX exception, possibly
wrapping another exception
public void uuids(long[] msblsb,
int start,
int length)
throws SAXException
PrimitiveTypeContentHandlerThe 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
.
uuids in interface PrimitiveTypeContentHandlermsblsb - the array of long containing pairs of most signficant
bits and least significant bits of the UUIDsstart - the start position in the arraylength - the number of long to read from the array. This will
be twice the number of UUIDs, which are pairs of two long values
SAXException - any SAX exception, possibly
wrapping another exception
public void numericCharacters(char[] ch,
int start,
int length)
throws SAXException
numericCharacters in interface RestrictedAlphabetContentHandlerSAXException
public void dateTimeCharacters(char[] ch,
int start,
int length)
throws SAXException
dateTimeCharacters in interface RestrictedAlphabetContentHandlerSAXException
public void alphabetCharacters(String alphabet,
char[] ch,
int start,
int length)
throws SAXException
alphabetCharacters in interface RestrictedAlphabetContentHandlerSAXException
public void characters(char[] ch,
int start,
int length,
boolean index)
throws SAXException
ExtendedContentHandler
characters in interface ExtendedContentHandlerch - the characters from the XML documentstart - the start position in the arraylength - the number of characters to read from the arrayindex - true if the characters are indexed, otherwise false.
SAXException - any SAX exception, possibly
wrapping another exceptionContentHandler.characters(char[], int, int)protected final int countAttributes(Attributes atts)
protected void encodeAttributes(Attributes atts)
throws IOException,
FastInfosetException
IOException
FastInfosetException
protected void encodeElement(String namespaceURI,
String qName,
String localName)
throws IOException
IOException
protected boolean encodeAttribute(String namespaceURI,
String qName,
String localName)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||