com.objsys.asn1j.runtime
Interface Asn1XmlXerEncoder

All Known Subinterfaces:
Asn1XerEncoder, Asn1XmlEncoder
All Known Implementing Classes:
Asn1XerEncodeBuffer, Asn1XerOutputStream, Asn1XmlEncodeBuffer, Asn1XmlOutputStream

public interface Asn1XmlXerEncoder

This is a base interface for encoding of ASN.1 messages as XML as specified in the W3C standard. It is implemented by both the Asn1XmlEncodeBuffer and Asn1XmlOutputStream.


Method Summary
 void copy(byte value)
          This method is used to copy a single byte to the encode buffer or stream.
 void copy(byte[] value)
          This method copies multiple bytes to the encode buffer or stream.
 void copy(byte[] value, int off, int len)
          This method copies multiple bytes to the encode buffer or stream.
 void copy(java.lang.String value)
          This method copies a character string to the encode buffer or stream.
 void decrLevel()
          This method decrements the element nesting level counter.
 void encodeBinStrValue(byte[] bits, int nbits)
          This method encodes XML binary string data
 void encodeData(java.lang.String value)
          This method encodes XML string data
 void encodeEndDocument()
          This method encodes standard trailor information at the end of the XML document.
 void encodeHexStrValue(byte[] data)
          This method encodes XML hexadecimal string data
 void encodeNamedValueElement(java.lang.String elemName)
          This method encodes an XML named value element tag.
 void encodeStartDocument()
          This method encodes standard header information at the beginning of the XML document.
 Asn1Context getContext()
          Return the context for this encoder.
 void incrLevel()
          This method increments the element nesting level counter.
 void indent()
          This methods indents by adding a new-line followed by whitespace corresponding to the current nesting level to the encode buffer.
 

Method Detail

copy

void copy(byte value)
          throws java.io.IOException
This method is used to copy a single byte to the encode buffer or stream. It first converts the byte to a hex character representation and then copies it to the output buffer.

Parameters:
value - The byte value to copy
Throws:
java.io.IOException - If I/O error occurs.

copy

void copy(byte[] value)
          throws java.io.IOException,
                 Asn1Exception
This method copies multiple bytes to the encode buffer or stream. It is assumed the byte are already formatted into a valid XML encoding type (for example, UTF-8).

Parameters:
value - Array of bytes to copy to the encode buffer
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

copy

void copy(byte[] value,
          int off,
          int len)
          throws java.io.IOException,
                 Asn1Exception
This method copies multiple bytes to the encode buffer or stream. It is assumed the byte are already formatted into a valid XML encoding type (for example, UTF-8).

Parameters:
value - Array of bytes to copy to the encode buffer
off - Starting offset in array
len - The length to be encoded
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

copy

void copy(java.lang.String value)
          throws java.io.IOException,
                 Asn1Exception
This method copies a character string to the encode buffer or stream.

Parameters:
value - The string value to copy
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

incrLevel

void incrLevel()
This method increments the element nesting level counter.


decrLevel

void decrLevel()
This method decrements the element nesting level counter.


encodeData

void encodeData(java.lang.String value)
                throws java.io.IOException,
                       Asn1Exception
This method encodes XML string data

Parameters:
value - String value to encode
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

encodeBinStrValue

void encodeBinStrValue(byte[] bits,
                       int nbits)
                       throws java.io.IOException,
                              Asn1Exception
This method encodes XML binary string data

Parameters:
bits - Bit string to encode
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

encodeHexStrValue

void encodeHexStrValue(byte[] data)
                       throws java.io.IOException,
                              Asn1Exception
This method encodes XML hexadecimal string data

Parameters:
data - Data to encode
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

encodeEndDocument

void encodeEndDocument()
                       throws java.io.IOException,
                              Asn1Exception
This method encodes standard trailor information at the end of the XML document.

Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

encodeStartDocument

void encodeStartDocument()
                         throws java.io.IOException,
                                Asn1Exception
This method encodes standard header information at the beginning of the XML document.

Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

encodeNamedValueElement

void encodeNamedValueElement(java.lang.String elemName)
                             throws java.io.IOException,
                                    Asn1Exception
This method encodes an XML named value element tag.

Parameters:
elemName - The name of element.
Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.

getContext

Asn1Context getContext()
Return the context for this encoder.


indent

void indent()
            throws java.io.IOException,
                   Asn1Exception
This methods indents by adding a new-line followed by whitespace corresponding to the current nesting level to the encode buffer.

Throws:
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.