org.ccnx.ccn.impl.encoding.XMLEncoder Interface Reference

List of all members.

Public Member Functions

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 (String tag) throws ContentEncodingException
 Writes a start element tag in the format defined by this codec to the stream.
void writeStartElement (long tag) throws ContentEncodingException
 Writes a start element tag in the format defined by this codec to the stream.
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 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 writeEndElement () throws ContentEncodingException
 Writes the end element defined by this codec to the stream.
void writeElement (String tag, String utf8Content) throws ContentEncodingException
 Writes a UTF-8 encoded string to the stream formatted according to this codec.
void writeElement (long tag, String utf8Content) throws ContentEncodingException
 Writes a UTF-8 encoded string to the stream formatted according to this codec.
void writeElement (String tag, String utf8Content, TreeMap< String, String > attributes) throws ContentEncodingException
 Writes a UTF-8 encoded string to the stream formatted according to this codec.
void writeElement (long tag, String utf8Content, TreeMap< String, String > attributes) throws ContentEncodingException
 Writes a UTF-8 encoded string to the stream formatted according to this codec.
void writeElement (String tag, byte[] binaryContent) throws ContentEncodingException
 Writes a binary element to the stream formatted according to this codec.
void writeElement (long tag, byte[] binaryContent) throws ContentEncodingException
 Writes a binary element to the stream formatted according to this codec.
void writeElement (String tag, byte[] binaryContent, int offset, int length) throws ContentEncodingException
 Writes a binary element to the stream formatted according to this codec.
void writeElement (long tag, byte[] binaryContent, int offset, int length) throws ContentEncodingException
 Writes a binary element to the stream formatted according to this codec.
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 (long 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 writeElement (long 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 writeElement (String tag, long value) throws ContentEncodingException
 Writes a number to the stream formatted according to this codec.
void writeElement (long tag, long value) throws ContentEncodingException
 Writes a number 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 writeUString (String utf8Content) throws ContentEncodingException
void writeBlob (byte[] binaryContent) throws ContentEncodingException
void writeBlob (byte[] binaryContent, int offset, int length) throws ContentEncodingException
void pushXMLDictionary (BinaryXMLDictionary dictionary)
 Some codecs use a dictionary to make encoding and decoding more efficient.
BinaryXMLDictionary popXMLDictionary ()
 Some codecs use a dictionary to make encoding and decoding more efficient.

Detailed Description

See also:
XMLDecoder

Member Function Documentation

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

BinaryXMLDictionary org.ccnx.ccn.impl.encoding.XMLEncoder.popXMLDictionary (  ) 

Some codecs use a dictionary to make encoding and decoding more efficient.

Those codecs typically load their default dictionary automatically. This call allows a user to manipulate the dictionary stack, removing the most recently added dictionary from the set used to encode.

Returns:
returns the removed dictionary
void org.ccnx.ccn.impl.encoding.XMLEncoder.pushXMLDictionary ( BinaryXMLDictionary  dictionary  ) 

Some codecs use a dictionary to make encoding and decoding more efficient.

Those codecs typically load their default dictionary automatically. This call allows a user to manipulate the dictionary stack, adding their own dictionaries to the set used to decode.

Parameters:
dictionary a dictionary to add to the set used for decoding
void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  tag,
long  value 
) throws ContentEncodingException

Writes a number to the stream formatted according to this codec.

Parameters:
tag start tag to use
value the number to encode
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( String  tag,
long  value 
) throws ContentEncodingException

Writes a number to the stream formatted according to this codec.

Parameters:
tag start tag to use
value the number to encode
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  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

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  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

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  tag,
byte[]  binaryContent,
int  offset,
int  length 
) 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
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( String  tag,
byte[]  binaryContent,
int  offset,
int  length 
) 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
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  tag,
byte[]  binaryContent 
) 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
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( String  tag,
byte[]  binaryContent 
) 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
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  tag,
String  utf8Content,
TreeMap< String, String >  attributes 
) throws ContentEncodingException

Writes a UTF-8 encoded string to the stream formatted according to this codec.

Parameters:
tag start tag to use
utf8Content the string data to encode
attributes the XML attributes to add to this tag
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( String  tag,
String  utf8Content,
TreeMap< String, String >  attributes 
) throws ContentEncodingException

Writes a UTF-8 encoded string to the stream formatted according to this codec.

Parameters:
tag start tag to use
utf8Content the string data to encode
attributes the XML attributes to add to this tag
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( long  tag,
String  utf8Content 
) throws ContentEncodingException

Writes a UTF-8 encoded string to the stream formatted according to this codec.

Parameters:
tag start tag to use
utf8Content the string data to encode
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeElement ( String  tag,
String  utf8Content 
) throws ContentEncodingException

Writes a UTF-8 encoded string to the stream formatted according to this codec.

Parameters:
tag start tag to use
utf8Content the string data to encode
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.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

Implemented in org.ccnx.ccn.impl.encoding.BinaryXMLEncoder, and org.ccnx.ccn.impl.encoding.TextXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeStartElement ( long  tag  )  throws ContentEncodingException

Writes a start element tag in the format defined by this codec to the stream.

Parameters:
tag the element start tag value defined by the dictionary, to skip string processing.
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.

void org.ccnx.ccn.impl.encoding.XMLEncoder.writeStartElement ( String  tag  )  throws ContentEncodingException

Writes a start element tag in the format defined by this codec to the stream.

Parameters:
tag the element start tag
Exceptions:
ContentEncodingException if there is an error encoding or writing the content

Implemented in org.ccnx.ccn.impl.encoding.GenericXMLEncoder.


The documentation for this interface was generated from the following file:
Generated on Fri May 13 16:27:39 2011 for Content-Centric Networking in Java by  doxygen 1.6.3