Re: [Simple-support] Deserialize only parts of a xml file
Brought to you by:
niallg
|
From: <Nia...@ub...> - 2009-04-20 14:36:35
|
Hi, It is very easy to do this with Simple. Check out the following in the tutorial. http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php# loosemap This will allow you to create objects which will parse only the annotations present on the class, and basically ignore/skip the rest. Niall -----Original Message----- From: Timo Rumland [mailto:cr...@ol...] Sent: 19 April 2009 00:14 To: sim...@li... Subject: [Simple-support] Deserialize only parts of a xml file Hello Simple users (and dev :), I'm faced with a (so I think) very common problem with a large number of serialized objects. I have to list all those objects in a JTable, with a few columns only showing some attributes of the serialized objects (let's say a name, a date and an ID). Now the first and easiest way is, just iteratate over all serialized xml files, deserialize each of them, get the needed attributes (name, date and ID) and create a table entry for it, then go on with the next xml file. Since the xml files each contains a lot more data than just name/date/ID, deserializing each of them is not memory efficient nor performant. What I need is some kind of streaming/parsing technology. So my question is, can I use the Simple Framework to do this, or can Simple only be used to fully deserialize an object? If Simple can't help me here, can you suggest another framework (I'm working with Java 6) to achieve my goal? Thanks a lot for your help! Regards, Timo ------------------------------------------------------------------------ ------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. UBS Limited is a company registered in England & Wales under company number 2035362, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS AG (London Branch) is registered as a branch of a foreign company under number BR004507, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS Clearing and Execution Services Limited is a company registered in England & Wales under company number 03123037, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS reserves the right to retain all messages. Messages are protected and accessed only in legally justified cases. |