[Simple-support] Deserialize a list of objects from one XML
Brought to you by:
niallg
|
From: Timo R. <cr...@ol...> - 2009-03-15 22:36:17
|
Hello, > In answer to your question yes, you can stream many objects to one > file. Also, simple should be much more memory efficient than XStream > at just about everything. > > Niall Niall, you wrote these lines on June 3rd (2008), but I could not find another question/answer related to this topic. Let's say, several objects, serialized to XML, are in one file (so there is more than one xml root in one file). Is it possible to deserialize it to a list of objects? I'm missing a method with a signature like public < T > List< T > serializer.read(Class< ? extends T > type, String xml ); (assuming the types of the objects in the file are all the same.) Is this possible out-of-the-box with simpleXML? Or do I have to preprocess and parse the XML code and then call the serializer.read method subsequently? Thanks a lot Best regards, Timo |