users@jaxb.java.net

Binding an annotated class to different schemas

From: Nitzan Volman <Nitzan_at_imperva.com>
Date: Mon, 3 Jul 2006 17:17:06 +0300

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