i just started playing with xstream.
i have an xml stream string which i have to convert to a flattened bean.
my xml message is
when extreme converts this into a bean it maps to an object graph. So my question object will have id, answerCount,url,publicationtime as properties defined.
Again i have a TopAnswer object which have its its meta data.
i wanted all this information to be transformed into a single flat object.
my proposed Question object will be flat and it will have properties like
id, answerCount,url,publicationtime,answerId,answerPublicationTime etc...
how do i provide this kind of complex xml message into a single flat bean.
Ok after reading more document i was able to flatten out the object.
Just wanted to make sure is this the correct way of doing it.
I still have the class structure defined and pass the xml.
I implemented a class which implements convertor interface and in the unmarhall method i am returning my own flattened objects.
This is what i am doing.
and in the QuestionsConvertor class in the unmarshal method i am returning a list of flattened QuestionItem objects.
Is there any other better way
please let me know
I've got no option but to sell you all for scientific experiments. Or a tiny ad: