Re: [Simple-support] Serializing List
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-10-21 02:20:54
|
The list needs to be in a serializable type, try
@Root
public class MyList {
@ElementList(inline=true)
List<MyClass> list;
}
This should work.
--- On Sat, 20/10/12, Tyrel Alastair Hunter <ial...@gm...> wrote:
> From: Tyrel Alastair Hunter <ial...@gm...>
> Subject: [Simple-support] Serializing List
> To: sim...@li...
> Received: Saturday, 20 October, 2012, 7:21 AM
> I am unable to serialize a list of Annotated
> objects is this possible
>
> I have a Class that is annotated and I can
> serialize them individually however if I put the items in
> a list and then try to serialize the list it does not
> serialize anything
>
>
> Sample:@rootpublic
> MyClass{
> @Attribute(name="name") public
> string name;
> @Attribute(name="id")
> public int id; public
> MyClass(@Attribute(name="name") String name,
> @Attribute(name="id") int id)
> { this.name= name;
> this.id = id;
> }}
> List<MyClass> list = new
> ArrayList<MyClass>();list.add(new
> MyClass("name 1", 1);
> list.add(new MyClass("name
> 2",2);serializer.write(list,output);
>
> -----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
>
|