jp.bitmeister.asn1.annotation
Annotation Type ASN1Enumeration


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

Indicates that a field is an element of enumerations.

If a field annotated as @ASN1Enumeration is present in a definition of a sub-class of INTEGER or ENUMERATED, value that can be contained in the type is limited to values of @ASN1Enumeration fields. An @ASN1Enumeration field must be a public static final field and the type shall be int, long or BigInteger. Each value of @ASN1Enumeration fields appearing in definition of a type must be distinct from the others. A sub-class of ENUMERATED must have at least one @ASN1Enumeration field.

For example, following ASN.1 definition :

 Sample ::= ENUMERATED {
        zero(0),
        one(1) }
 
can be translated as :
 public class Sample extends ENUMERATED {
 
        @ASN1Enumeration
        public static final int zero = 0;
 
        @ASN1Enumeration
        public static final int one = 1;
 
 }
 

Author:
WATANABE, Jun.
See Also:
INTEGER, ENUMERATED



Copyright © 2012 BitMeister Inc. All Rights Reserved.