com.objsys.asn1j.runtime
Class Asn1OpenExt

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

public class Asn1OpenExt
extends Asn1Type

This is a container class for holding open type elements that may occur within an open type extension (i.e. a ... at the end of a constructed type or a ..., ... at some other point in a constructed type).

See Also:
Serialized Form

Field Summary
 java.util.ArrayList value
          The value is a list of Asn1OpenType objects.
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1Type
BIT_STRING, BMPString, BOOLEAN, DATE, DATE_TIME, DURATION, ENUMERATED, EOC, EXTERNAL, GeneralString, GeneralTime, GraphicString, IA5String, INTEGER, NULL, NumericString, OBJECT_IDENTIFIER, ObjectDescriptor, OCTET_STRING, OID_IRI, OpenType, PrintableString, REAL, RELATIVE_OID_IRI, RelativeOID, SEQUENCE, SET, T61String, TeletexString, TIME, TIME_OF_DAY, UniversalString, UTCTime, UTF8String, VideotexString, VisibleString
 
Constructor Summary
Asn1OpenExt()
           
 
Method Summary
 void decode(Asn1BerDecodeBuffer buffer, boolean explicit, int implicitLength)
          This method decodes an ASN.1 open type extension value using the Basic Encoding Rules (BER).
 void decode(Asn1PerDecodeBuffer buffer)
          This method decodes an open type extension in a SEQUENCE or SET construct using the packed encoding rules (PER).
 void decodeComponent(Asn1BerDecodeBuffer buffer)
          This method decodes a single component of a BER open type extension by decoding an open type value and appending it to the list of open type objects.
 void decodeEventComponent(Asn1BerDecodeBuffer buffer)
          This method decodes a single component of a BER open type extension by decoding an open type value and appending it to the list of open type objects, this function also triggers event handler code, with element name "..."
 void decodeExtension(Asn1JsonDecodeBuffer buffer, java.lang.String name)
          Decode a single occurrence of an extension from JSON and add an Asn1OpenType for it to the list of extensions.
 Asn1OpenType decodeOpenType(Asn1PerDecodeBuffer buffer, boolean present, int index)
          This method decodes a single open type extension item in a SEQUENCE or SET construct using the packed encoding rules (PER).
 int encode(Asn1BerEncodeBuffer buffer, boolean explicit)
          This method encodes an ASN.1 open type extension value using the Basic Encoding Rules (BER).
 void encode(Asn1BerOutputStream out, boolean explicit)
          This method encodes an ASN.1 open type extension value using the Basic Encoding Rules (BER) and writes it into the stream.
 void encode(Asn1JsonOutputStream outstream)
          Encode the open extension elements to JSON
 void encode(Asn1PerEncodeBuffer buffer)
          This method encodes an ASN.1 open type extension value using the Packed Encoding Rules (PER).
 void encode(Asn1PerOutputStream out)
          This method encodes an ASN.1 open type extension value using the Packed Encoding Rules (PER).
 void encode(Asn1XerEncoder buffer)
          This method encodes an ASN.1 open type extension value using the XML Encoding Rules (XER).
 void encode(Asn1XmlEncoder buffer)
          This method encodes an ASN.1 integer value using the XML Encoding as specified in the XML schema standard (asn2xsd).
 void encodeExtBits(Asn1PerEncodeBuffer buffer)
          This method encodes an ASN.1 open type extension value bits using the Packed Encoding Rules (PER).
 boolean equals(java.lang.Object o)
          Compares extension lists.
 int hashCode()
          Returns the hashcode for an extension list.
 void setOpenType(Asn1OpenType object, int index)
          This method will add the given open type object to the open extension element list at the given index.
 java.lang.String toString()
          This method will return a string representation of the open extension value.
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1Type
clone, decode, decode, decode, decode, decode, decodeXML, encode, encode, equals, getLength, getTypeName, indent, isOpenType, matchTag, matchTag, pdiag, print, setKey, setOpenType
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public transient java.util.ArrayList value
The value is a list of Asn1OpenType objects. Each of these objects contains a fully encoded extension item.

Constructor Detail

Asn1OpenExt

public Asn1OpenExt()
Method Detail

decodeEventComponent

public void decodeEventComponent(Asn1BerDecodeBuffer buffer)
                          throws Asn1Exception,
                                 java.io.IOException
This method decodes a single component of a BER open type extension by decoding an open type value and appending it to the list of open type objects, this function also triggers event handler code, with element name "..."

Parameters:
buffer - Decode message buffer object
Throws:
Asn1Exception
java.io.IOException

decodeComponent

public void decodeComponent(Asn1BerDecodeBuffer buffer)
                     throws Asn1Exception,
                            java.io.IOException
This method decodes a single component of a BER open type extension by decoding an open type value and appending it to the list of open type objects.

Parameters:
buffer - Decode message buffer object
Throws:
Asn1Exception
java.io.IOException

decode

public void decode(Asn1BerDecodeBuffer buffer,
                   boolean explicit,
                   int implicitLength)
            throws Asn1Exception,
                   java.io.IOException
This method decodes an ASN.1 open type extension value using the Basic Encoding Rules (BER).

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

encode

public int encode(Asn1BerEncodeBuffer buffer,
                  boolean explicit)
           throws Asn1Exception
This method encodes an ASN.1 open type extension value using the Basic Encoding Rules (BER).

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1Type
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 open type extension in a SEQUENCE or SET construct using the packed encoding rules (PER). This method will capture each extension item in a separate open type object and store it in the value public member list variable. If optional items are absent, null placeholders will be inserted in the list.

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

decodeOpenType

public Asn1OpenType decodeOpenType(Asn1PerDecodeBuffer buffer,
                                   boolean present,
                                   int index)
                            throws Asn1Exception,
                                   java.io.IOException
This method decodes a single open type extension item in a SEQUENCE or SET construct using the packed encoding rules (PER). It will then add the item to the open extension element list.

Parameters:
buffer - Decode message buffer object
present - Flag indicating whether element is present
index - Index of element in the object array
Throws:
Asn1Exception
java.io.IOException

encode

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

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

encodeExtBits

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

Parameters:
buffer - Encode message buffer object
Throws:
Asn1Exception
java.io.IOException

setOpenType

public void setOpenType(Asn1OpenType object,
                        int index)
This method will add the given open type object to the open extension element list at the given index.

Parameters:
object - Open type object
index - Index in open type list where element is to be placed

toString

public java.lang.String toString()
This method will return a string representation of the open extension value. The format is the ASN.1 value format for each open type in the extension.

Overrides:
toString in class java.lang.Object
Returns:
Stringified representation of the value

encode

public void encode(Asn1BerOutputStream out,
                   boolean explicit)
            throws Asn1Exception,
                   java.io.IOException
This method encodes an ASN.1 open type extension value using the Basic Encoding Rules (BER) and writes it into the stream.

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1Type
Parameters:
out - BER Output Stream object
explicit - Flag indicating element is explicitly tagged
Throws:
java.io.IOException - Any exception thrown by the Asn1BerOutputStream.
Asn1Exception - Thrown, if operation is failed.

encode

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

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1Type
Parameters:
out - PER Output Stream object
Throws:
java.io.IOException - Any exception thrown by the Asn1PerOutputStream.
Asn1Exception - Thrown, if operation is failed.

encode

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

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

encode

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

Parameters:
buffer - Encode message buffer object
Throws:
java.io.IOException
Asn1Exception

decodeExtension

public void decodeExtension(Asn1JsonDecodeBuffer buffer,
                            java.lang.String name)
                     throws java.io.IOException
Decode a single occurrence of an extension from JSON and add an Asn1OpenType for it to the list of extensions.

Parameters:
buffer - Decode message buffer object
name - The name of the extension element (previously decoded). This becomes a part of the character data held in the Asn1OpenType object, so that the character data represents a full JSONNamedValue.
Throws:
java.io.IOException

encode

public void encode(Asn1JsonOutputStream outstream)
            throws java.io.IOException
Encode the open extension elements to JSON

Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)
Compares extension lists. Returns true under the following conditions:

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare.
Returns:
True on success, false on failure.

hashCode

public int hashCode()
Returns the hashcode for an extension list.

Overrides:
hashCode in class Asn1Type