users@jaxb.java.net

RE: Re: hasEnum & Class.forName in CodeModel

From: <HeruMartinus.Salim_at_infineon.com>
Date: Tue, 21 Nov 2006 14:28:24 +0100

Have found a problem.

When inside the UntypedListField I check for an enum type, there are no
enum types found, because I added the enum type inside the run() method
of the PluginImpl. While those FieldRenderer is called from method
onActivated() (before the run() method), the enum are not there yet.

Can we add the enum inside onActivated() method? But there are no class
outline as the parameter?
Have no idea how to do this.

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
>