JAXB class ref prevent enum generation

2019-09-16 08:15发布

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条回答
三岁会撩人
2楼-- · 2019-09-16 09:02

You must use following snippet

<jxb:bindings node="//xs:simpleType[@name='myEnum']">
      <jxb:typesafeEnumClass ref="com.myapp.enums.MyEnum"/>
</jxb:bindings>
查看更多
登录 后发表回答