jp.bitmeister.asn1.type
Class ASN1Module

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Module
Direct Known Subclasses:
BuiltInModule

public abstract class ASN1Module
extends java.lang.Object

The base class for classes which represents an ASN.1 module.

An instance of sub-class of ASN1Module represents an ASN.1 module and provides instantiate methods that instantiates an ASN.1 data from an ASN.1 tag or a type identifier. ASN.1 types can indicate a module that they are included in by ASN1ModuleRef annotation. In addition, ASN.1 types declared as public static member classes of an sub-class of ASN1Module class are automatically included in the module.

Default tagging mode for this module may be indicated by an @ASN1ModuleTags annotation or explicit tagging is used as default.

Author:
WATANABE, Jun.
See Also:
ASN1Modules, ASN1ModuleTags, ASN1ModuleRef

Constructor Summary
protected ASN1Module()
          Instantiates an ASN1Module.
 
Method Summary
 java.lang.String identifier()
          Returns the identifier of this module.
 ASN1Type instantiate(ASN1TagClass tagClass, int tagNumber)
          Instantiates an ASN.1 data specified by the tag.
 ASN1Type instantiate(java.lang.String typeIdentifier)
          Instantiates an ASN.1 data specified by the type identifier.
protected  void register(java.lang.Class<? extends ASN1Type> type)
          Registers the ASN.1 type to this module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASN1Module

protected ASN1Module()
Instantiates an ASN1Module.

Method Detail

identifier

public java.lang.String identifier()
Returns the identifier of this module.

Returns:
The identifier of this module.

register

protected void register(java.lang.Class<? extends ASN1Type> type)
Registers the ASN.1 type to this module.

Parameters:
type - The type to be registered.

instantiate

public ASN1Type instantiate(ASN1TagClass tagClass,
                            int tagNumber)
Instantiates an ASN.1 data specified by the tag.

Parameters:
tagClass - The tag class.
tagNumber - The tag number.
Returns:
An instance of ASN.1 data.

instantiate

public ASN1Type instantiate(java.lang.String typeIdentifier)
Instantiates an ASN.1 data specified by the type identifier.

Parameters:
typeIdentifier - The identifier of the type.
Returns:
An instance of ASN.1 data.