jp.bitmeister.asn1.type.builtin
Class CHOICE

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.StructuredType
          extended by jp.bitmeister.asn1.type.SelectiveType
              extended by jp.bitmeister.asn1.type.builtin.CHOICE
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
EMBEDDED_PDV.Identification, EXTERNAL.Encoding

public abstract class CHOICE
extends SelectiveType

Represents ASN.1 'CHOICE' type.

This is the base class used for defining 'CHOICE' types. A sub-class of CHOICE shall have one or more fields annotated as @ASN1Alternative. When a value is assigned to one of the @ASN1Alternative fields of an instance, the field becomes selected field. If an instance has more than two fields which assigned value, the instance can't be encoded.

Author:
WATANABE, Jun.
See Also:
ASN1Alternative

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
CHOICE()
          Instantiates an empty CHOICE.
CHOICE(ASN1TagClass tagClass, int tagNumber, ASN1Type data)
          Instantiates a CHOICE and initialize it with parameters.
CHOICE(ASN1Type data)
          Instantiates a CHOICE and initialize it with the parameter.
 
Method Summary
<E extends java.lang.Throwable>
void
accept(ASN1Visitor<E> visitor)
          Accepts the ASN1Visitor and calls a visit method of the visitor.
 
Methods inherited from class jp.bitmeister.asn1.type.SelectiveType
alternative, clear, clearSelection, clone, get, hashCode, hasValue, matches, selectedIdentifier, selectedTag, selectedValue, set, set, valueEquals
 
Methods inherited from class jp.bitmeister.asn1.type.ASN1Type
equals, instantiate, specification, toString, validate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CHOICE

public CHOICE()
Instantiates an empty CHOICE.


CHOICE

public CHOICE(ASN1Type data)
Instantiates a CHOICE and initialize it with the parameter. The ASN.1 tag that assigned to the type of the data is used for select a field.

Parameters:
data - The data to be assigned.

CHOICE

public CHOICE(ASN1TagClass tagClass,
              int tagNumber,
              ASN1Type data)
Instantiates a CHOICE and initialize it with parameters.

Parameters:
tagClass - The tag class used for select a field.
tagNumber - The tag number used for select a field.
data - The data to be assigned.
Method Detail

accept

public <E extends java.lang.Throwable> void accept(ASN1Visitor<E> visitor)
            throws E extends java.lang.Throwable
Description copied from class: ASN1Type
Accepts the ASN1Visitor and calls a visit method of the visitor.

Specified by:
accept in class ASN1Type
Parameters:
visitor - The visitor.
Throws:
E extends java.lang.Throwable