beanit / asn1bean

ASN1bean (formerly known as jASN1) is a Java ASN.1 BER and DER encoding/decoding library
https://www.beanit.com/asn1/
Apache License 2.0
110 stars 45 forks source link

Add a choiceId for CHOICE #12

Open lamplet opened 6 years ago

lamplet commented 6 years ago

When i compile an asn.1 like this: PDU ::= CHOICE { a A, b B }

i want a choiceId in the generated class, so that i can process it with switch/case. And constants CHOICE_ID_A, CHOICE_ID_B like this:

public class PDU implements Serializable
{
    public static final int CHOICE_ID_A = 0;

    public static final int CHOICE_ID_B = 1;

    private int choiceId;

    private A a = null;

    private B b = null;
}
sfeuerhahn commented 6 years ago

I'll put that on my todo list.