|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@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 element 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. If automatic tagging is not used, value
parameter
can be omitted.
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;
}
SelectiveType
,
CHOICE
Optional Element Summary | |
---|---|
int |
value
Indicates defined order of this element. |
public abstract int value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |