users@jaxb.java.net

Re: Retrieving substitutionGroup information from JAXBElement

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Wed, 30 Sep 2009 11:22:37 +0200

On Wed, Sep 30, 2009 at 10:27 AM, Claus Nagel <claus.nagel_at_gmail.com> wrote:

> Hi all -
>
> in a current project I get JAXBElement<?> objects returned from the
> unmarshal method of the JAXB Unmarshaller. In order to correctly process
> these objects I need to know whether or not the xs:substitutionGroup
> attribute is set for the corresponding xs:element in the XML Schema
> document.


Can you please explain why?

You should be able to distinguish the element alternatives resulting from
the group by looking at the XML element tag.

-W



> Is there an easy way to query the JAXBElement<?> object in order to get
> this information? Or do I need to parse the ObjectFactory class using Java
> reflection? If I have to parse the ObjectFactory class, does the
> JAXBElement<?> contain a link to the proper class (because I have to deal
> with plenty of ObjectFactory classes and want to avoid scanning all of
> them...). Or is there a completely different approach possible?
>
> Thanks for any suggestions,
> Cheers,
> Claus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>