org.ccnx.ccn.impl.encoding.TextXMLEncoder Class Reference

An implementation of XMLEncoder for the Text codec. More...

Inheritance diagram for org.ccnx.ccn.impl.encoding.TextXMLEncoder:

org.ccnx.ccn.impl.encoding.GenericXMLEncoder org.ccnx.ccn.impl.encoding.XMLEncoder org.ccnx.ccn.impl.encoding.XMLEncoder

List of all members.

Public Member Functions

 TextXMLEncoder ()
 Create a BinaryXMLEncoder initialized with the default dictionary obtained from BinaryXMLDictionary.getDefaultDictionary().
 TextXMLEncoder (XMLDictionary 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


Detailed Description

An implementation of XMLEncoder for the Text codec.

See also:
TextXMLCodec

XMLEncoder


Constructor & Destructor Documentation

org.ccnx.ccn.impl.encoding.TextXMLEncoder.TextXMLEncoder ( XMLDictionary  dictionary  ) 

Create a BinaryXMLEncoder initialized with a specified dictionary.

Parameters:
dictionary the dictionary to use, if null the default dictionary is used.


Member Function Documentation

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.

Parameters:
ostream the output stream to encode to
Exceptions:
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.

Exceptions:
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.

Parameters:
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
Exceptions:
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.

Parameters:
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
Exceptions:
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,
TreeMap< String, String >  attributes 
) throws ContentEncodingException

Writes a binary element to the stream formatted according to this codec.

Parameters:
tag start tag to use
binaryContent the binary data to encode
attributes the XML attributes to add to this tag
Exceptions:
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,
int  offset,
int  length,
TreeMap< String, String >  attributes 
) throws ContentEncodingException

Writes a binary element to the stream formatted according to this codec.

Parameters:
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
Exceptions:
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.writeDateTime ( String  tag,
CCNTime  dateTime 
) throws ContentEncodingException

Writes a quantized timestamp to the stream formatted according to this codec.

Parameters:
tag start tag to use
dateTime the timestamp to encode
Exceptions:
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.

Parameters:
tag start tag to use
dateTime the timestamp to encode
Exceptions:
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.writeEndElement (  )  throws ContentEncodingException

Writes the end element defined by this codec to the stream.

Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implements org.ccnx.ccn.impl.encoding.XMLEncoder.


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:44:52 2012 for Content-Centric Networking in Java by  doxygen 1.5.6