java - JAX-B enum generation with equal elements -


i running problem generation of enum jax-b. have language code in schema equal elements separating via case. example have entry de , 1 de results in combination other language codes in emun schema like:

/**  * afar  *   */ @xmlenumvalue("aa") value_1("aa"),  /**  * afar  *   */ @xmlenumvalue("aa") value_2("aa"), 

what bit problematic when trying access value via value_x naming. there way prevent that. expecting enum values aa, de , on know of must unique. in such case difference case.

if problem naming value_1, can fix customizing enum member names for, say, lowercase entries:

<jaxb:bindings schemalocation=".../myxsd" node="/xs:schema">     <jaxb:bindings node="xs:simpletype[@name='mylangtype']">         <jaxb:typesafeenumclass>             <jaxb:typesafeenummember name="lower_aa" value="aa"/>             <!-- ... -->         </jaxb:typesafeenumclass>     </jaxb:bindings> </jaxb:bindings> 

you may consider mapping type directly java.util.locale using jaxb:javatype.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -