• Post Reply Bookmark Topic Watch Topic
  • New Topic

customizing xmAdaptor in JAXB  RSS feed

 
r ko
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have hashtable which contains columnName and column value. My hashtable contains key,value pair as like

columnName= columnValue
columnName= columnValue
columnName= columnValue
columnName= columnValue





I would like to convert hashtable into xml by using xmlAdapter.


I was following the links

http://javaevangelist.blogspot.com/2011/12/java-tip-of-day-generic-jaxb-map-v.html
http://blog.bdoughan.com/2012/08/removing-jaxbelement-from-your-domain.html
http://stackoverflow.com/questions/4975068/xmladapter-for-hashmap


I see that we need to define the rootElement everywhere.either like @XmlRootElement(Name ="abc") or @XmlRootElement
public class abc{}


My xml should look like following.




i would like to know can we generate the xml with root tag as first 3 characters of columnname instead of class names or at the annotation level. Is it possible to generate xml from with custom root element name by using xmlAdapter?


Thanks



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!