Re: [Simple-support] Complex Object Limited Cycle Strategy
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-11-01 07:35:41
|
Hi,
I am not sure what you are trying to do here?
Niall
--- On Tue, 30/10/12, Nhat Ngo <phu...@gm...> wrote:
> From: Nhat Ngo <phu...@gm...>
> Subject: [Simple-support] Complex Object Limited Cycle Strategy
> To: sim...@li...
> Received: Tuesday, 30 October, 2012, 11:30 PM
> Hi all,
> Let's say I got the following
> objects:
> Sector.java@Rootpublic class Sector
> {
>
> @Attribute String name;
> @Element Int value;
>
> @ElementList(entry="neighbor") List<Sector>
> neighbours;
>
>
> public Sector(@Attribute name,
> @Element value) { ...
>
> }
>
> public addNeighbour(sector) { ...
>
> }}
> Sectors.javapublic class Sectors
> {
>
> @ElementList List<Sector>
> sectors; ...
> }
> How would I serialize and deserialize the above
> objects into the following sample xml:<Sectors>
> <Sector
> name = "one">
> <value>5</value>
> <neighbours class=...>
>
> <neighbour name="two"
> />
> </neighbours> </Sector>
> <Sector
> name = "two">
> <value>2</value>
> <neighbours class=...>
>
> <neighbour name="one"
> /> <neighbour
> name="three" />
>
>
> </neighbours> </Sector>
>
> ...
> </Sectors>
> Where the Neighbours are referred by designated
> name and not referring to the whole object. I've tried
> CycleStrategy but it seems to refer to every element in
> object and not simply a specific one I needed.
>
> Nhat
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|