File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Problem in using xstream annotations for complex java objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problem in using xstream annotations for complex java objects" Watch "Problem in using xstream annotations for complex java objects" New topic
Author

Problem in using xstream annotations for complex java objects

Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Hi,

I have a java object - Entity.java



I want to convert Entity.java to xml in the following format -



I have done something like this -


How do i annotate location and country?

Thanks.



Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
Deeps Mistry wrote:Hi,

I have a java object - Entity.java



I want to convert Entity.java to xml in the following format -



I have done something like this -


How do i annotate location and country?

Thanks.





Can anyone please help me out with this?

Thanks
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 539
    
    3
How do i annotate location and country?

With the layout given, you practically no need to annotate location. For country, you simply alias the variable to country.

Most of the tag names will fall in place because you make the variable names conducive to the intended output.

Or do I miss something you have not shown (apart from those getters or setters or constructors...)?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in using xstream annotations for complex java objects