users@jaxb.java.net

Re: JAXB serialization: Option to have a reference to inner objects

From: Dmitry <redmitry_at_list.ru>
Date: Wed, 26 Aug 2015 12:29:36 +0200

You can use the List<> with @XmlAttribute (the value of list must be XML
simple).

Cheers,

D.

On 8/26/2015 12:20 PM, Anurag Sharma wrote:
> Hi,
>
> We are serializing a large number of objects. Some objects have
> attributes as list of objects.
>
> I found an option in Texo serializer where such list of objects are
> saved as references and a lot of space is saved rather than showing
> same object multiple times. eg shown below:
>
> |<target:LogicalFact id="6022" version="28"
> created="2014-12-01T15:53:59.000+0000" logicalColumns="#/16651 #/10549
> #/17142 #/16898 #/16542 #/16551 #/16832 #/16623 #/17230 #/16645
> #/16393 #/16968 #/16575 #/17179 #/17195 #/16717 #/16636 #/16560
> #/16410 #/16814 #/16610 #/16691 #/17173 #/16705 #/16838"/> |
>
> In above example, all logical columns are references. This saves space
> by avoiding duplicate information. Is there any such option available
> with JAXB serializer.
>
> Regards
> Anurag
>