com.objsys.asn1j.runtime
Class Asn1XerOpenType

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1Type
      extended by com.objsys.asn1j.runtime.Asn1OctetString
          extended by com.objsys.asn1j.runtime.Asn1OpenType
              extended by com.objsys.asn1j.runtime.Asn1XerOpenType
All Implemented Interfaces:
Asn1TypeIF, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class Asn1XerOpenType
extends Asn1OpenType

This is a container class for holding the an ASN.1 open type value. This is a special version of the class that is only generated for the XER encoding rules.

See Also:
Serialized Form

Nested Class Summary
 class Asn1XerOpenType.SaxHandler
           
 
Field Summary
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1OpenType
mEncodeBuffer, mLength, mTextEncoding
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1OctetString
TAG, value
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1Type
BIT_STRING, BMPString, BOOLEAN, ENUMERATED, EOC, EXTERNAL, GeneralString, GeneralTime, GraphicString, IA5String, INTEGER, NULL, NumericString, OBJECT_IDENTIFIER, ObjectDescriptor, OCTET_STRING, OpenType, PrintableString, REAL, RelativeOID, SEQUENCE, SET, T61String, TeletexString, UniversalString, UTCTime, UTF8String, VideotexString, VisibleString
 
Constructor Summary
Asn1XerOpenType()
          This constructor creates an empty type that can be used in a decode method call to receive an encoded value.
Asn1XerOpenType(Asn1EncodeBuffer buffer)
          This constructor initializes an open type using an encoded component.
Asn1XerOpenType(byte[] data)
          This constructor initializes an open type from the given byte array.
Asn1XerOpenType(byte[] data, int offset, int nbytes)
          This constructor initializes the open type from a portion of the given byte array.
 
Method Summary
 void decode(Asn1BerDecodeBuffer buffer, boolean explicit, int implicitLength)
          This method decodes an ASN.1 open type value.
 void decode(Asn1PerDecodeBuffer buffer)
          This method decodes an ASN.1 octet string value using the packed encoding rules (PER).
 int encode(Asn1BerEncodeBuffer buffer, boolean explicit)
          This method encodes an ASN.1 open type value.
 void encode(Asn1PerEncodeBuffer buffer)
          This method encodes an ASN.1 open type value using the Packed Encoding Rules (PER).
 void encode(Asn1XerEncoder buffer)
          This method is the base implementation of the standard XML Encoding Rules (XER) encode method.
 void encode(Asn1XerEncoder buffer, java.lang.String elemName)
          This method encodes an ASN.1 open type value using the XML Encoding Rules (XER).
 void encode(Asn1XmlEncoder buffer, java.lang.String elemName, java.lang.String nsPrefix)
          This method encodes an ASN.1 open type value using the XML Encoding as specified in the XML schema standard(asn2xsd).
 Asn1XerSaxHandler getSaxHandler()
           
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1OpenType
encode, encode, toString
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1OctetString
compareTo, decode, decodeXER, decodeXML, encode, encode, encodeAttribute, equals, equals, getLength, toInputStream
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1Type
clone, decode, decode, decode, encode, encode, getTypeName, indent, isOpenType, matchTag, matchTag, pdiag, print, setKey, setOpenType
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Asn1XerOpenType

public Asn1XerOpenType()
This constructor creates an empty type that can be used in a decode method call to receive an encoded value.


Asn1XerOpenType

public Asn1XerOpenType(byte[] data)
This constructor initializes an open type from the given byte array. The array is assumed to contain a previously encoded message component.

Parameters:
data - Byte array containing a previously encoded message component.

Asn1XerOpenType

public Asn1XerOpenType(byte[] data,
                       int offset,
                       int nbytes)
This constructor initializes the open type from a portion of the given byte array. A new byte array is created starting at the given offset and consisting of the given number of bytes.

Parameters:
data - Byte array containing an octet string in binary form.
offset - Starting offset in data from which to copy bytes
nbytes - Number of bytes to copy from target array

Asn1XerOpenType

public Asn1XerOpenType(Asn1EncodeBuffer buffer)
This constructor initializes an open type using an encoded component. This can be used if a header (for example, a ROSE header) is being prepended to a pre-encoded component.

Parameters:
buffer - Reference to encode buffer into which component type was encoded.
Method Detail

decode

public void decode(Asn1BerDecodeBuffer buffer,
                   boolean explicit,
                   int implicitLength)
            throws Asn1Exception,
                   java.io.IOException
This method decodes an ASN.1 open type value.

Specified by:
decode in interface Asn1TypeIF
Overrides:
decode in class Asn1OpenType
Parameters:
buffer - Decode message buffer object
explicit - Flag indicating element is explicitly tagged
implicitLength - Length of contents if implicit
Throws:
Asn1Exception
java.io.IOException

encode

public int encode(Asn1BerEncodeBuffer buffer,
                  boolean explicit)
           throws Asn1Exception
This method encodes an ASN.1 open type value. The value is assumed to be an already-encoded message component and will be copied to the encoded buffer. An optimization is available in which no copy will performed if the encoded component is already present in the encode buffer. This is done if the form of constructor specifiying only a component length is used.

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1OpenType
Parameters:
buffer - Encode message buffer object
explicit - Flag indicating element is explicitly tagged
Returns:
Length of encoded component
Throws:
Asn1Exception

decode

public void decode(Asn1PerDecodeBuffer buffer)
            throws Asn1Exception,
                   java.io.IOException
This method decodes an ASN.1 octet string value using the packed encoding rules (PER). The string is assumed to not contain a size constraint.

Specified by:
decode in interface Asn1TypeIF
Overrides:
decode in class Asn1OctetString
Parameters:
buffer - Decode message buffer object
Throws:
Asn1Exception
java.io.IOException

encode

public void encode(Asn1PerEncodeBuffer buffer)
            throws Asn1Exception,
                   java.io.IOException
This method encodes an ASN.1 open type value using the Packed Encoding Rules (PER).

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1OpenType
Parameters:
buffer - Encode message buffer object
Throws:
Asn1Exception
java.io.IOException

encode

public void encode(Asn1XmlEncoder buffer,
                   java.lang.String elemName,
                   java.lang.String nsPrefix)
            throws java.io.IOException,
                   Asn1Exception
This method encodes an ASN.1 open type value using the XML Encoding as specified in the XML schema standard(asn2xsd).

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1OctetString
Parameters:
buffer - Encode message buffer object
elemName - Element name
nsPrefix - Element namespace prefix value
Throws:
java.io.IOException - Any exception thrown by the underlying stream.
Asn1Exception - Thrown, if operation is failed.

encode

public void encode(Asn1XerEncoder buffer,
                   java.lang.String elemName)
            throws java.io.IOException,
                   Asn1Exception
This method encodes an ASN.1 open type value using the XML Encoding Rules (XER).

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1OctetString
Parameters:
buffer - Encode message buffer object
elemName - XML element name used to wrap string
Throws:
java.io.IOException - Any exception thrown by the underlying stream.
Asn1Exception - Thrown, if operation is failed.

encode

public void encode(Asn1XerEncoder buffer)
            throws java.io.IOException,
                   Asn1Exception
Description copied from class: Asn1Type
This method is the base implementation of the standard XML Encoding Rules (XER) encode method. This method invokes the generated method with element name set to null. This will cause the ASN.1 type name to be used as the top-level element name.

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1Type
Parameters:
buffer - XER Encode message buffer object
Throws:
java.io.IOException - Any exception thrown by the underlying stream.
Asn1Exception - Thrown, if operation is failed.

getSaxHandler

public Asn1XerSaxHandler getSaxHandler()