users@jaxb.java.net

Re: Finding implementation class from FieldOutline?

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 16 Dec 2008 12:43:40 +0100

Hi.

> I'm trying to write a plugin for a class generated from schema
> (AbstractPreferences) that we've customised like this:
>
> <jaxb:class implClass="service.prefs.impl.PreferencesImpl"/>
>
> where PreferencesImpl is a hand-written class. This works somewhat, the
> ObjectFactory correctly returns a PreferencesImpl in
> createAbstractPreferences(). However I have two problems:
>
> 1. AbstractPreferences also has a list of child elements of the same type,
> but this is generated as a List<AbstractPreferences>, not a
> List<PreferencesImpl> - is this correct? It seems like this should be a list
> of PreferencesImpl.

I think it gets the "least common denominator" from possible classes.

> 2. From the plugin, when I attempt to customise the "children" field using
> the FieldOutline I can't find any way to find out what the implementation
> class of the list element type is. Is there a way to get at this
> information?

Oh, it's a bit hard and I don't have a workspace handy.
You can get this information from the underlying CPropertyInfo, look
for getTypes() method or something like this. You can get CClassInfo
of the element from there and the use the outline to check which
ClassOutline was generated for this class info.

Let me know if you have further difficulties, I'll try to help.

Bye.
/lexi

Bye.
/lexi