jp.bitmeister.asn1.type
Class NamedTypeSpecification

java.lang.Object
  extended by jp.bitmeister.asn1.type.NamedTypeSpecification
All Implemented Interfaces:
java.lang.Comparable<NamedTypeSpecification>
Direct Known Subclasses:
ElementSpecification

public class NamedTypeSpecification
extends java.lang.Object
implements java.lang.Comparable<NamedTypeSpecification>

Specifications of an element that contained in a StructuredType.

An instance of this class contains static information of an element of a structured type which applied by annotations and type definitions. Each element is a Field object declared in a StructuredType and annotated as @ASN1Element or @ASN1Alternative.

Author:
WATANABE, Jun.
See Also:
ASN1Element, ASN1Alternative, StructuredType

Method Summary
 int compareTo(NamedTypeSpecification compared)
           
 java.lang.String identifier()
          Returns the identifier of this element.
 ASN1Type instantiate()
          Creates a new instance of this element type.
 boolean isSameType(NamedTypeSpecification obj)
          Tests if the element represented by the NamedTypeSpecification is the same ASN.1 type of this element.
 boolean matches(ASN1TagClass tagClass, int tagNumber)
          Tests if the ASN.1 tag matches this element.
 ASN1TagValue tag()
          Returns the tag of this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

identifier

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

Returns:
The identifier.

tag

public ASN1TagValue tag()
Returns the tag of this element.

Returns:
The tag.

isSameType

public boolean isSameType(NamedTypeSpecification obj)
Tests if the element represented by the NamedTypeSpecification is the same ASN.1 type of this element.

Parameters:
obj - The NamedTypeSpecification to be compared.
Returns:
true when the field is the same ASN.1 type.

matches

public boolean matches(ASN1TagClass tagClass,
                       int tagNumber)
Tests if the ASN.1 tag matches this element.

Parameters:
tagClass - ASN.1 tag class.
tagNumber - ASN.1 tag number.
Returns:
true when the tag class and tag number matches this element.

instantiate

public ASN1Type instantiate()
Creates a new instance of this element type.

Returns:
An empty instance of this element type.

compareTo

public int compareTo(NamedTypeSpecification compared)
Specified by:
compareTo in interface java.lang.Comparable<NamedTypeSpecification>