jp.bitmeister.asn1.type.builtin
Class CHOICE
java.lang.Object
jp.bitmeister.asn1.type.ASN1Type
jp.bitmeister.asn1.type.StructuredType
jp.bitmeister.asn1.type.SelectiveType
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
|
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 |
<R,E extends java.lang.Throwable>
R |
|
accept(ASN1Visitor<R,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, getElement, hashCode, hasValue, matches, selectedIdentifier, selectedTag, selectedValue, set, set, valueEquals |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
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.
accept
public <R,E extends java.lang.Throwable> R accept(ASN1Visitor<R,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.
- Returns:
- Result.
- Throws:
E - When an error occured in the visit method of the
visitor.
E extends java.lang.Throwable