com.objsys.asn1j.runtime
Class Asn1Tag

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1Tag
All Implemented Interfaces:
java.io.Serializable

public class Asn1Tag
extends java.lang.Object
implements java.io.Serializable

This is a container class for holding the components of an ASN.1 tag value.

See Also:
Serialized Form

Field Summary
static short APPL
          Mask value for an APPLICATION tag
static short Bit8Mask
          Bit 8 (MSB) octet mask value
static short ClassMask
          Mask value to mask the class bits from a tag
static short CONS
          Mask value for CONSTRUCTED form
static short CTXT
          Mask value for a context-specific tag
static Asn1Tag ENUM
          ASN.1 ENUMERATED type tag value
static Asn1Tag EOC
          ASN.1 end-of-contents (EOC) type tag value
static boolean EXPL
          This specifies that explicit tagging should be used.
static short EXTIDCODE
          Mask value for extended tag identifier indicator
static short FormMask
          Mask value to mask the form bit from a tag
static short IDMask
          Mask value to mask the tag ID bits from a tag
static boolean IMPL
          This specifies that implicit tagging should be used.
static short L7BitsMask
          Lower 7 bits octet mask value
 short mClass
          Tag class value (UNIV, APPL, CTXT, or PRIV)
 short mForm
          Tag form value (PRIM or CONS)
 int mIDCode
          Tag ID code
static short PRIM
          Mask value for PRIMITIVE form
static short PRIV
          Mask value for a PRIVATE tag
static Asn1Tag SEQUENCE
          ASN.1 SEQUENCE type tag value
static Asn1Tag SET
          ASN.1 SET type tag value
static short UNIV
          Mask value for a UNIVERSAL tag
 
Constructor Summary
Asn1Tag()
          The default constructor initializes all fields to zero.
Asn1Tag(Asn1Tag _tag)
          The copy constructor initializes all fields to those from the given tag parameter.
Asn1Tag(short class_, short form, int idCode)
          This constructor initializes all fields to the given values
 
Method Summary
 boolean equals(java.lang.Object _tag)
          This method compares this tag with the given tag value for equality.
 boolean equals(short class_, short form, int idCode)
          This method compares this tag with the given tag value for equality.
 boolean isConstructed()
          This method tests if the tag is constructed.
 boolean isEOC()
          This method tests if the tag is an end-of-contents (EOC) tag.
 java.lang.String toString()
          This method will return a formatted string representing the tag value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXPL

public static final boolean EXPL
This specifies that explicit tagging should be used.

See Also:
Constant Field Values

IMPL

public static final boolean IMPL
This specifies that implicit tagging should be used.

See Also:
Constant Field Values

UNIV

public static final short UNIV
Mask value for a UNIVERSAL tag

See Also:
Constant Field Values

APPL

public static final short APPL
Mask value for an APPLICATION tag

See Also:
Constant Field Values

CTXT

public static final short CTXT
Mask value for a context-specific tag

See Also:
Constant Field Values

PRIV

public static final short PRIV
Mask value for a PRIVATE tag

See Also:
Constant Field Values

ClassMask

public static final short ClassMask
Mask value to mask the class bits from a tag

See Also:
Constant Field Values

PRIM

public static final short PRIM
Mask value for PRIMITIVE form

See Also:
Constant Field Values

CONS

public static final short CONS
Mask value for CONSTRUCTED form

See Also:
Constant Field Values

FormMask

public static final short FormMask
Mask value to mask the form bit from a tag

See Also:
Constant Field Values

EXTIDCODE

public static final short EXTIDCODE
Mask value for extended tag identifier indicator

See Also:
Constant Field Values

IDMask

public static final short IDMask
Mask value to mask the tag ID bits from a tag

See Also:
Constant Field Values

ENUM

public static final Asn1Tag ENUM
ASN.1 ENUMERATED type tag value


EOC

public static final Asn1Tag EOC
ASN.1 end-of-contents (EOC) type tag value


SEQUENCE

public static final Asn1Tag SEQUENCE
ASN.1 SEQUENCE type tag value


SET

public static final Asn1Tag SET
ASN.1 SET type tag value


Bit8Mask

public static final short Bit8Mask
Bit 8 (MSB) octet mask value

See Also:
Constant Field Values

L7BitsMask

public static final short L7BitsMask
Lower 7 bits octet mask value

See Also:
Constant Field Values

mClass

public transient short mClass
Tag class value (UNIV, APPL, CTXT, or PRIV)


mForm

public transient short mForm
Tag form value (PRIM or CONS)


mIDCode

public transient int mIDCode
Tag ID code

Constructor Detail

Asn1Tag

public Asn1Tag()
The default constructor initializes all fields to zero.


Asn1Tag

public Asn1Tag(Asn1Tag _tag)
The copy constructor initializes all fields to those from the given tag parameter.

Parameters:
tag - The input tag value to copy.

Asn1Tag

public Asn1Tag(short class_,
               short form,
               int idCode)
This constructor initializes all fields to the given values

Parameters:
class_ - Tag class value (UNIV, APPL, CTXT, or PRIV)
form - Tag form value (PRIM or CONS)
idCode - Tag identifier code
Method Detail

equals

public boolean equals(short class_,
                      short form,
                      int idCode)
This method compares this tag with the given tag value for equality.

Parameters:
class_ - Tag class value (UNIV, APPL, CTXT, or PRIV)
form - Tag form value (PRIM or CONS)
idCode - Tag identifier code
Returns:
True if tags are equal

equals

public boolean equals(java.lang.Object _tag)
This method compares this tag with the given tag value for equality.

Overrides:
equals in class java.lang.Object
Parameters:
tag - Asn1Tag object to which this tag is to be compared
Returns:
True if tags are equal

isConstructed

public boolean isConstructed()
This method tests if the tag is constructed.

Returns:
True if tag is constructed.

isEOC

public boolean isEOC()
This method tests if the tag is an end-of-contents (EOC) tag.

Returns:
True if tag is an EOC.

toString

public java.lang.String toString()
This method will return a formatted string representing the tag value. The form is "[ ]" (i.e. the ASN.1 standard syntax for a tag value).

Overrides:
toString in class java.lang.Object
Returns:
Formatted tag string