• 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

How to customize the field name of the generated Java object using JAXB custom bindings ?

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello All,

I'm trying to generate JAXB generated objects for the below sample xsd.



and the class that gets generated without any custom bindings is



as you see the field name is "usa" and setters/getters are getUSA/setUSA.

Is there any custom setting/binding to have the field name also be generated as "USA" instead of "usa", that way the field and property are all "USA". I do not have a problem with marshalling/unmarshalling using JAXB, but while using Jackson I'm having trouble if I need to return a List of USA and No setter being generated in that case.

There may be various ways of solving this problem, but I would like to start exploring the option of having the field name generated as "USA". Is it possible ?

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic