arraylist of array, how to serialize it

View: New views
3 Messages — Rating Filter:   Alert me  

arraylist of array, how to serialize it

by Stefano-53 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all.
i need to serialize a thing like this:

@ElementList
private List<Bean[]> Buffer = new ArrayList<Bean[]>();

but i can't.

i'd to create another calss to serialize the Bean[] like this:

class arrayBean{
   @ElementArray
    private Bean[] beans;

and then  serialize in this way
@ElementList
private List<arrayBean> Buffer = new ArrayList<arrayBean>();

?
--
Stefano

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: arraylist of array, how to serialize it

by Quirino Zagarese-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Stefano,
I guess this is the only way to do that, but I'm not completely sure about it.
I wonder, then, if it could be useful to be able to do something like this:

@ElementList(
innerArray=@ElementArray(type=Bean.class)
)
private List<Bean[]> Buffer = new ArrayList<Bean[]>();

This could be a good way  to handle this kind of situations without having to create a wrapping class for the inner collection.
What do you think Niall?
Regards


2009/10/21 Stefano <elstefen@...>
Hi all.
i need to serialize a thing like this:

@ElementList
private List<Bean[]> Buffer = new ArrayList<Bean[]>();

but i can't.

i'd to create another calss to serialize the Bean[] like this:

class arrayBean{
   @ElementArray
    private Bean[] beans;

and then  serialize in this way
@ElementList
private List<arrayBean> Buffer = new ArrayList<arrayBean>();

?
--
Stefano

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support




--
Quirino Zagarese

Italian OpenLaszlo Community  - www.laszloitalia.org

EU4RIA: Laszlo+Java, easily - eu4ria.googlecode.com

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: arraylist of array, how to serialize it

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
There are a few ways you can do this. If bean were a primitive it would work fine, as primitives are serialized with Transform implementations. If you were happy that the bean could be serialized this way, you could implement one. However, I think given it is a bean it would be better to have it serialized as XML elements and attributes. Currently the easiest way to do it is as you have suggested, or use a List<Bean> instead.
 
Niall


From: Quirino Zagarese [mailto:quirino@...]
Sent: 21 October 2009 14:20
To: Stefano
Cc: simple-support@...
Subject: Re: [Simple-support] arraylist of array, how to serialize it

Hi Stefano,
I guess this is the only way to do that, but I'm not completely sure about it.
I wonder, then, if it could be useful to be able to do something like this:

@ElementList(
innerArray=@ElementArray(type=Bean.class)
)
private List<Bean[]> Buffer = new ArrayList<Bean[]>();

This could be a good way  to handle this kind of situations without having to create a wrapping class for the inner collection.
What do you think Niall?
Regards


2009/10/21 Stefano <elstefen@...>
Hi all.
i need to serialize a thing like this:

@ElementList
private List<Bean[]> Buffer = new ArrayList<Bean[]>();

but i can't.

i'd to create another calss to serialize the Bean[] like this:

class arrayBean{
   @ElementArray
    private Bean[] beans;

and then  serialize in this way
@ElementList
private List<arrayBean> Buffer = new ArrayList<arrayBean>();

?
--
Stefano

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support




--
Quirino Zagarese

Italian OpenLaszlo Community  - www.laszloitalia.org

EU4RIA: Laszlo+Java, easily - eu4ria.googlecode.com
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com

***********************************************************************************

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support