views:

34

answers:

1

Hi.
Is there a way to tell JAXB to not remove underscores when creating getter/setter names from XML Schema?
Reason: this causes loss of information and it is harder to trip between XML and Java; e.g. in written communications where one participant might be confused about "different names".

Example: NR_ROR should not become getNRROR but getNR_ROR.
Note: I believe that the less-mangled names are worth the "violation" of Java naming convention.
TIA
karolrvn

A: 

Have a look at the underscoreBinding that jaxb provides. See, for example, in the docs here -> http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html

I have never used it since I like camelCaseWords, but it sounds like it does what you are looking for.

Yoni
Thanks for answer.<br/>Maybe enableJavaNamingConventions = false ?<br/>However I didn't find any description of this
karolrvn