Download ASN.1 Compiler Version 6.3 Java User`s Manual Objective Systems
Transcript
SET OF Value Specification
Generated Java constants:
public
new
new
new
...
static final <SequenceOfType> <name> =
<SequenceOfType>[] {
<ElemType> (<elem1value>),
<ElemType> (<elem2value>),
};
For example, consider the following declaration:
SeqOfType ::= SEQUENCE OF INTEGER
value SeqOfType ::= { 1, 2 }
This would result in the following Java constant being generated for value:
public static final SeqOfType value = new SeqOfType[] {
new Asn1Integer(1),
new Asn1Integer(2)
};
SET OF Value Specification
The value code generation for the ASN.1 SET OF type is that same as that for SEQUENCE OF
described above.
CHOICE Value Specification
A CHOICE value specification causes a final static instance of the Java class generated for the
CHOICE to be generated.
ASN.1 production:
<name> <ChoiceType> ::= elemname : <elemvalue>
Generated Java constants:
public static final <ChoiceType> <name> =
new <ChoiceType> (<ElemCode>,
new <ElemType> (<elemvalue>));
For example, consider the following declaration:
ChoiceType ::= CHOICE { oid OBJECT IDENTIFIER, id INTEGER }
value ChoiceType ::= id: 1
This would result in the following Java constant being generated:
public static final ChoiceType value =
new ChoiceType (ChoiceType._ID, new Asn1Integer(1));
61