Yup,
I got it now.
Thanks for the info about the needed methods. :-)
Heru
> -----Original Message-----
> From: Aleksei Valikov [mailto:valikov_at_gmx.net]
> Sent: Tuesday, November 21, 2006 2:05 PM
> To: users_at_jaxb.dev.java.net
> Subject: Re: hasEnum & Class.forName in CodeModel
>
> Hi.
>
> > Here is the code fragment:
>
> Ok.
>
> I'd generate
>
> final Port port;
> if (type == Port.SIGNAL_PORT)
> {
> port = new SignalPort();
> }
> else if (type == Port.BUS_SLAVE_PORT)
> {
> ...
> }
> else
> {
> throw new IllegalArgumentException(...); }
>
>
> I already told you how to get enums from the class.
> Correspondence between enums and classes is your thing, you
> should know how to do it.
>
> Conditionals are done with block._if(...)._then(...)._else.
>
> You only need to define correspondence between your enums and
> classes somehow.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>