Use XStream(it supports full object graph) or whatever you like to serialize the graph to xml.
You cannot use Guice to deserialize. You need to use XStream again. What Guice can do is inject again the dependencies using Injector#injectMembers (usually on the fields you don't want serialized - marked transient). On 22 jul., 13:26, abp <[email protected]> wrote: > Oh, I've searched a lot. > Search results are massively screwed by hibernate, javaee, > spring(persistence.XML, web.XML etc). > > I will read the linked discussion later. But after a fast scan throug > I think again, aren't there any helpers for this? > Or, at least, a detailed explanation of the patterns to use? > > Another problem is that i'm not in a web or hibernate persistence > context (and have zero experience with), > so refernences to "spring does this with xxx" or "hibernate xxx does > that" to describe approaches doesn't help me. > > I just want to write an object graph to xml(optimally without CGLIB > generated things) and load/rebuild the object graph with guice. > > On 22 Jul., 12:59, Alen Vrečko <[email protected]> wrote: > > > Hi, > > > maybe some previous discussions such as > > >http://groups.google.com/group/google-guice/browse_thread/thread/4799... > > > might give you some ideas. Try searching the group for "serialization" > > for more. > > > Cheers > > Alen > > > On 21 jul., 23:39, abp <[email protected]> wrote: > > > > Hello, > > > > is there an easy way to store objects in xml and later, load the xml > > > into an object again? > > > I think the main problem here is that most xml serializers like > > > XStream or simple xml inject the object graph on theirselves. > > > I'am not really sure if something like a translator of object > > > creations will really help, because i don't know enough about either > > > guice and > > > XML serializers. I don't know for example, how a xml deserialization > > > process or guice should know, that a instance created as member > > > of one object is the same instance as created for another member of > > > another object previously. > > > > Any help or suggestions, please? > > > Thanks in advance. > > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
