users@jaxb.java.net

Re: Binding an annotated class to different schemas

From: Dennis Sosnoski <dms_at_sosnoski.com>
Date: Thu, 06 Jul 2006 10:17:06 +1200

Hi Nitzan,

Since I just plugged JiBX in another thread I may as well do it here,
too. JiBX supports multiple binding definitions, allowing you to use the
same classes with multiple versions of XML (just a separate binding for
each version). AFAIK JAXB does not support any way of doing this.

- Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



Nitzan Volman wrote:
>
> Hello,
>
> I am currently evaluating JAXB with the intention to integrate it into
> an existing application,
>
> My application has a large amount of Java Beans which are currently
> serialized into XML the “primitive” way.
>
> (these classes implement an XMLSerializable interface with read() and
> write methods() )
>
> My intention is to get rid of “XMLSerializable” interface and use
> annotations on the existing classes.
>
> This brings me to the problem:
>
> I need to support to types of XML marshaling,
>
> - a verbose xml, which contains every field in my data objects (used
> for backup etc’)
>
> - a limited xml, which only contains a subset of the fields in the
> data objects (sent over the net – where the extra fields form a
> serious overhead).
>
> My question is how can I do this with JAXB 2.0 (using annotations)
>
> Thanks
>
> /Nitzan
>