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
Post a Comment