jp.bitmeister.asn1.annotation
Annotation Type ASN1Alternative


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface ASN1Alternative

Indicates that a field is a 'CHOICE' alternative.

If an @ASN1Alternative annotation is present on a field, the field is treated as an alternative of a sub-class of SelectiveType. A field annotated as @ASN1Alternative must be declared as public non-final non-static, and the type shall be a sub-class of ASN1Type. The value parameter represents an order of appearance of a field in an ASN.1 type definition and is used for automatic tagging.

For example, following ASN.1 definition :

 Sample ::= CHOICE {
        number  INTEGER,
        bool    BOOLEAN }
 
can be translated as :
 public class Sample extends CHOICE {
 
        @ASN1Alternative(0)
        public INTEGER number;
 
        @ASN1Alternative(1)
        public BOOLEAN bool;
 
 }
 

Author:
WATANABE, Jun.
See Also:
SelectiveType, CHOICE

Optional Element Summary
 int value
          Indicates defined order of this element.
 

value

public abstract int value
Indicates defined order of this element.

Returns:
Order of this element.
Default:
0