• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

customizing xmAdaptor in JAXB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



reply
    Bookmark Topic Watch Topic
  • New Topic