An implementation of XMLEncoder for the Text codec. More...
Public Member Functions | |
TextXMLEncoder () | |
Create a BinaryXMLEncoder initialized with the default dictionary obtained from BinaryXMLDictionary.getDefaultDictionary(). | |
TextXMLEncoder (BinaryXMLDictionary dictionary) | |
Create a BinaryXMLEncoder initialized with a specified dictionary. | |
void | beginEncoding (OutputStream ostream) throws ContentEncodingException |
Initiates encoding and handles any startup steps, including writing the start document if one is defined for this codec. | |
void | endEncoding () throws ContentEncodingException |
Handles any necessary steps for ending the encoding, including writing the end document if one is defined for this codec. | |
void | writeStartElement (long tag, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes. | |
void | writeStartElement (String tag, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes. | |
void | writeUString (String utf8Content) throws ContentEncodingException |
void | writeBlob (byte[] binaryContent) throws ContentEncodingException |
void | writeBlob (byte[] binaryContent, int offset, int length) throws ContentEncodingException |
void | writeElement (String tag, byte[] binaryContent, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeElement (String tag, byte[] binaryContent, int offset, int length, TreeMap< String, String > attributes) throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec. | |
void | writeDateTime (String tag, CCNTime dateTime) throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec. | |
void | writeDateTime (long tag, CCNTime dateTime) throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec. | |
void | writeEndElement () throws ContentEncodingException |
Writes the end element defined by this codec to the stream. | |
Protected Attributes | |
XmlSerializer | _serializer = null |
An implementation of XMLEncoder for the Text codec.
org.ccnx.ccn.impl.encoding.TextXMLEncoder.TextXMLEncoder | ( | BinaryXMLDictionary | dictionary | ) |
Create a BinaryXMLEncoder initialized with a specified dictionary.
dictionary | the dictionary to use, if null the default dictionary is used. |
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.beginEncoding | ( | OutputStream | ostream | ) | throws ContentEncodingException |
Initiates encoding and handles any startup steps, including writing the start document if one is defined for this codec.
ostream | the output stream to encode to |
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.endEncoding | ( | ) | throws ContentEncodingException |
Handles any necessary steps for ending the encoding, including writing the end document if one is defined for this codec.
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeDateTime | ( | long | tag, | |
CCNTime | dateTime | |||
) | throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec.
tag | start tag to use | |
dateTime | the timestamp to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeDateTime | ( | String | tag, | |
CCNTime | dateTime | |||
) | throws ContentEncodingException |
Writes a quantized timestamp to the stream formatted according to this codec.
tag | start tag to use | |
dateTime | the timestamp to encode |
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeElement | ( | String | tag, | |
byte[] | binaryContent, | |||
int | offset, | |||
int | length, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
offset | the offset into binaryContent at which to start | |
length | the number of bytes of binaryContent to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Reimplemented from org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeElement | ( | String | tag, | |
byte[] | binaryContent, | |||
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a binary element to the stream formatted according to this codec.
tag | start tag to use | |
binaryContent | the binary data to encode | |
attributes | the XML attributes to add to this tag |
ContentEncodingException | if there is an error encoding or writing the content |
Reimplemented from org.ccnx.ccn.impl.encoding.GenericXMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeEndElement | ( | ) | throws ContentEncodingException |
Writes the end element defined by this codec to the stream.
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeStartElement | ( | String | tag, | |
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes.
tag | the element start tag | |
attributes | the (attribute, value) pairs to write as attributes of the element start tag, if null or empty no attributes are written |
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.
void org.ccnx.ccn.impl.encoding.TextXMLEncoder.writeStartElement | ( | long | tag, | |
TreeMap< String, String > | attributes | |||
) | throws ContentEncodingException |
Writes a start element tag in the format defined by this codec to the stream, together with a set of attributes.
This does string lookup of the attribute names.
tag | the element start tag | |
attributes | the (attribute, value) pairs to write as attributes of the element start tag, if null or empty no attributes are written |
ContentEncodingException | if there is an error encoding or writing the content |
Implements org.ccnx.ccn.impl.encoding.XMLEncoder.