JAXB class ref prevent enum generation

此生再无相见时 提交于 2019-12-13 07:29:12

问题


I've found this QA already and was able to prevent the generation of classes, but enums are still generated.

I've tried to prevent it with custom binding:

<jxb:bindings node="//xs:simpleType[@name='myEnum']">
      <jxb:class ref="com.myapp.enums.MyEnum" />
</jxb:bindings>

but it is not working for me. Is there any possibility to prevent the generation of enums or maybe another customization?


回答1:


You must use following snippet

<jxb:bindings node="//xs:simpleType[@name='myEnum']">
      <jxb:typesafeEnumClass ref="com.myapp.enums.MyEnum"/>
</jxb:bindings>


来源:https://stackoverflow.com/questions/38824179/jaxb-class-ref-prevent-enum-generation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!