Class TagContext

java.lang.Object
net.aifusion.asn.TagContext

public class TagContext extends Object
Class to represent a tag context for context sensitive tags
A tag context defines the <tagNumber,tag> mapping for context sensitive tags used for encoding or decoding BER when IMPLICIT or AUTO tag definitions are being used.
Author:
Sharad Singhal
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Create a tag context that defines the tagged types in an ASN.1 Encoding
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    advance the mapping to the next mapping in the ASN.1 context definition
    getExpectedTag(int tagNumber)
    Get the expected Universal Tag type for a tag number in the current context
    getExpectedTag(int tagNumber, int contextId)
    Get the expected Universal Tag type for a tag number in a given context
    void
    Reset the current context to the initial mapping

    Methods inherited from class java.lang.Object Link icon

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • TagContext Link icon

      public TagContext(List<Map<Integer,Tag>> context)
      Create a tag context that defines the tagged types in an ASN.1 Encoding
      Parameters:
      context - - context to be used within the current definition
  • Method Details Link icon

    • advance Link icon

      public void advance()
      advance the mapping to the next mapping in the ASN.1 context definition
    • reset Link icon

      public void reset()
      Reset the current context to the initial mapping
    • getExpectedTag Link icon

      public Tag getExpectedTag(int tagNumber)
      Get the expected Universal Tag type for a tag number in the current context
      Parameters:
      tagNumber - - tag number to look up
      Returns:
      - Tag representing expected data type. Null if no such tag found
    • getExpectedTag Link icon

      public Tag getExpectedTag(int tagNumber, int contextId)
      Get the expected Universal Tag type for a tag number in a given context
      Parameters:
      tagNumber - - tag number to look up
      contextId - - contextId to use
      Returns:
      - Tag representing expected data type. Null if no such tag found