|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objsys.asn1j.runtime.Asn1MessageBuffer
com.objsys.asn1j.runtime.Asn1EncodeBuffer
com.objsys.asn1j.runtime.Asn1XmlEncodeBuffer
This class handles the encoding of ASN.1 messages as specified in the XML Encoding (non-XER) as specified in the XML schema standard.
| Field Summary |
| Fields inherited from class com.objsys.asn1j.runtime.Asn1EncodeBuffer |
mByteIndex, mData, mSizeIncrement, SIZE_INCREMENT |
| Fields inherited from interface com.objsys.asn1j.runtime.Asn1XmlEncoder |
XMLDATA, XMLEND, XMLINDENT, XMLINIT, XMLSTART |
| Constructor Summary | |
Asn1XmlEncodeBuffer()
The default constructor creates an XML encode buffer object with the default size increment and canonical set to false. |
|
Asn1XmlEncodeBuffer(int sizeIncrement)
The parameterized constructor creates an XML encode buffer object with size increment set to the given value. |
|
| Method Summary | |
void |
binDump(java.io.PrintStream out,
java.lang.String varName)
This method dumps the encoded message in a human-readable format showing a bit trace of all fields to the given print output stream. |
protected void |
checkSize(int bytesRequired)
This method determines if the encode buffer can hold the requested number of bytes. |
void |
copy(byte value)
This method is used to copy a single byte to the encode buffer. |
void |
copy(byte[] value)
This method copies multiple bytes to the encode buffer. |
void |
copy(byte[] value,
int off,
int len)
This method copies multiple bytes to the encode buffer. |
void |
copy(java.lang.String value)
This method copies a character string to the encode buffer. |
void |
decrLevel()
This method decrements the element nesting level counter. |
void |
encodeAttr(java.lang.String qname,
java.lang.String value)
This method encodes an XML attribute value. |
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 |
encodeDoubleValue(double value,
java.lang.String elemName,
java.lang.String nsPrefix)
This method encodes an XML REAL (double) value (with start and end tags). |
void |
encodeEmptyElement(java.lang.String elemName,
java.lang.String nsPrefix)
This method encodes an XML empty element tag |
void |
encodeEndDocument()
This method encodes standard trailor information at the end of the XML document. |
void |
encodeEndElement(java.lang.String elemName,
java.lang.String nsPrefix)
This method encodes an XML end element tag |
void |
encodeHexStrValue(byte[] data)
This method encodes XML hexadecimal string data |
void |
encodeNamedValue(java.lang.String valueName,
java.lang.String elemName,
java.lang.String nsPrefix)
This method encodes an XML named value (with start and end tags) |
void |
encodeNamedValueElement(java.lang.String elemName)
This method encodes an XML named value element. |
void |
encodeObjectId(int[] data)
This method encodes Object Identifiers and Relative OIDs data |
void |
encodeStartDocument()
This method encodes standard header information at the beginning of the XML document. |
void |
encodeStartElement(java.lang.String elemName,
java.lang.String nsPrefix,
boolean terminate)
This method encodes an XML start element tag. |
void |
encodeXSIAttrs()
This method encodes XSI attributes. |
byte[] |
getBuffer()
This method returns a reference to the byte buffer used to hold the encoded message. |
java.io.InputStream |
getInputStream()
This method returns an input stream object reference to the message buffer contents (i.e. the encoded data). |
byte[] |
getMsgCopy()
This method returns the encoded message in a byte array. |
int |
getMsgLength()
This method returns the length (in bytes) of the encoded message component. |
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. |
void |
reset()
This method resets the buffer to allow a new record to be encoded into it. |
void |
setIndent(int value)
This method sets the number of spaces per indentation. |
void |
setMixedContent(boolean value)
This method sets the mixed content flag which indicates that this buffer will be used to encode mixed content. |
void |
setTermStart(boolean value)
This method sets the start element termination required flag. |
void |
setXSIAttrs(Asn1XmlXSIAttrs value)
This method sets the XSI attributes object to the given value. |
void |
write(java.io.OutputStream out)
This method writes the encoded record to the given output stream. |
| Methods inherited from class com.objsys.asn1j.runtime.Asn1EncodeBuffer |
binDump, hexDump, hexDump, initBuffer |
| Methods inherited from class com.objsys.asn1j.runtime.Asn1MessageBuffer |
hexDump, hexDump, setKey |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Asn1XmlEncodeBuffer()
public Asn1XmlEncodeBuffer(int sizeIncrement)
sizeIncrement - The initial size in bytes of an encode buffer.
If the buffer becomes full, it will be expanded by the amount. If
this parameter is set to zero, the default increment will be used.| Method Detail |
public void binDump(java.io.PrintStream out,
java.lang.String varName)
binDump in class Asn1EncodeBufferpublic void copy(byte value)
copy in interface Asn1XmlXerEncodercopy in class Asn1EncodeBuffervalue - The byte value to copy
public void copy(byte[] value)
throws Asn1Exception
copy in interface Asn1XmlXerEncodercopy in class Asn1EncodeBuffervalue - Array of bytes to copy to the encode buffer
Asn1Exception
public void copy(byte[] value,
int off,
int len)
throws java.io.IOException,
Asn1Exception
copy in interface Asn1XmlXerEncodervalue - Array of bytes to copy to the encode bufferoff - Starting offset in arraylen - The length to be encoded
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void copy(java.lang.String value)
throws java.io.IOException,
Asn1Exception
copy in interface Asn1XmlXerEncodervalue - The string value to copy
Asn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.protected void checkSize(int bytesRequired)
checkSize in class Asn1EncodeBufferbytesRequired - Number of required bytes.public void decrLevel()
decrLevel in interface Asn1XmlXerEncoder
public void encodeData(java.lang.String value)
throws java.io.IOException,
Asn1Exception
encodeData in interface Asn1XmlXerEncodervalue - String value to encode
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void encodeAttr(java.lang.String qname,
java.lang.String value)
throws java.io.IOException,
Asn1Exception
encodeAttr in interface Asn1XmlEncoderqname - Attribute qualified name.value - Attribute value in string form.
java.io.IOException
Asn1Exception
public void encodeBinStrValue(byte[] bits,
int nbits)
throws java.io.IOException,
Asn1Exception
encodeBinStrValue in interface Asn1XmlXerEncoderbits - Bit string to encode
Asn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.
public void encodeDoubleValue(double value,
java.lang.String elemName,
java.lang.String nsPrefix)
throws java.io.IOException,
Asn1Exception
encodeDoubleValue in interface Asn1XmlEncodervalue - The value to be encoded.elemName - The name of element. If null, then start and end
tags won't be encoded.nsPrefix - Element namespace prefix value
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void encodeEmptyElement(java.lang.String elemName,
java.lang.String nsPrefix)
throws java.io.IOException,
Asn1Exception
encodeEmptyElement in interface Asn1XmlEncoderelemName - The name of element.nsPrefix - The namespace prefix of element.
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void encodeEndDocument()
throws java.io.IOException,
Asn1Exception
encodeEndDocument in interface Asn1XmlXerEncoderjava.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void encodeEndElement(java.lang.String elemName,
java.lang.String nsPrefix)
throws java.io.IOException,
Asn1Exception
encodeEndElement in interface Asn1XmlEncoderelemName - The name of element.nsPrefix - Namespace prefix.
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void encodeHexStrValue(byte[] data)
throws java.io.IOException,
Asn1Exception
encodeHexStrValue in interface Asn1XmlXerEncoderdata - Data to encode
Asn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.
public void encodeNamedValue(java.lang.String valueName,
java.lang.String elemName,
java.lang.String nsPrefix)
throws Asn1Exception,
java.io.IOException
encodeNamedValue in interface Asn1XmlEncodervalueName - The name of value.elemName - The name of element.nsPrefix - Element namespace prefix value
Asn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.
public void encodeNamedValueElement(java.lang.String elemName)
throws Asn1Exception,
java.io.IOException
encodeNamedValueElement in interface Asn1XmlXerEncoderelemName - The name of element.
java.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.
public void encodeObjectId(int[] data)
throws java.io.IOException,
Asn1Exception
encodeObjectId in interface Asn1XmlXerEncoderdata - Object identifier to encode
Asn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.
public void encodeStartDocument()
throws java.io.IOException,
Asn1Exception
encodeStartDocument in interface Asn1XmlXerEncoderAsn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.
public void encodeStartElement(java.lang.String elemName,
java.lang.String nsPrefix,
boolean terminate)
throws Asn1Exception,
java.io.IOException
encodeStartElement in interface Asn1XmlEncoderelemName - The name of element.nsPrefix - The namespace prefix of element.
Asn1Exception - Thrown, if operation is failed.
java.io.IOException - If I/O error occurs.
public void encodeXSIAttrs()
throws Asn1Exception,
java.io.IOException
encodeXSIAttrs in interface Asn1XmlEncoderAsn1Exception
java.io.IOExceptionpublic byte[] getBuffer()
public java.io.InputStream getInputStream()
getInputStream in class Asn1MessageBufferpublic byte[] getMsgCopy()
getMsgCopy in class Asn1EncodeBufferpublic int getMsgLength()
getMsgLength in class Asn1EncodeBufferpublic void incrLevel()
incrLevel in interface Asn1XmlXerEncoder
public void indent()
throws Asn1Exception,
java.io.IOException
indent in interface Asn1XmlXerEncoderjava.io.IOException - If I/O error occurs.
Asn1Exception - Thrown, if operation is failed.public void reset()
reset in class Asn1EncodeBufferpublic void setIndent(int value)
setIndent in interface Asn1XmlEncodervalue - Number of spaces per indentation level.public void setMixedContent(boolean value)
value - Boolean valuepublic void setTermStart(boolean value)
value - Boolean valuepublic void setXSIAttrs(Asn1XmlXSIAttrs value)
setXSIAttrs in interface Asn1XmlEncodervalue - XSI attributes object
public void write(java.io.OutputStream out)
throws java.io.IOException
write in class Asn1EncodeBufferout - Output stream to which record is to be written
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||