4

I have an xsd that I'm using to generate an object model in Java using JAXB and I want the Lists it generates to be renamed to xyzList instead of xyz. Is there a way to do this without having to add an entry in the bindings file for each list?

For example this xsd fragment:

<xs:element name="RegulatoryEL" minOccurs="0" maxOccurs="unbounded">

generates this:

protected List<RegulatoryEL> RegulatoryEL;

but I want something like:

protected List<RegulatoryEL> RegulatoryELList;

2 Answers2

0

JAXB (JSR-222) does not provide a global setting to control how field/property names are generated for elements that can appear multiple times. Using standard config you will need to do this on a per element basis using an external binding file.


To do this in a more general way you could create your own XJC extension:

Community
  • 1
  • 1
bdoughan
  • 147,609
  • 23
  • 300
  • 400
0

For manipulate names you can use plugin and register you own name converter. For example look at xjcnormalize.

Detailed explanation from their author you may find in this answer: JAXB convert non-ASCII characters to ASCII characters

Hubbitus
  • 5,161
  • 3
  • 41
  • 47