• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert only selected Object elements to XML through Annotation?

 
Chitra Jagannathan
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we Convert only selected Object elements to XML through Annotation?

Ex:
Person
- name
- empId
- address
- city
- profession

I want to convert Person object to XML through annotation with only empId and profession.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, if I want a custom serialization of an object I just build a string in the correct XML format with the desired values.

 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XStream can do this easily.
 
g tsuji
Ranch Hand
Posts: 651
3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the use of annotation @XmlTransient.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic