JAXB:防止重新生成类

ins*_*ins 6 xsd jaxb

我在保持课堂重生方面遇到了麻烦.我

我有一个模式A,它在模式B中导入.然后在模式C中导入模式B.

在模式A中,我有两个simpleTypes,它们是字符串的枚举:

<xs:simpleType name="blah_type">
<xs:restriction base="xs:string">
        <xs:enumeration value="blah_1"/>
        <xs:enumeration value="blah_2"/>
        <xs:enumeration value="blah_3"/>
        <xs:enumeration value="blah_4"/>
        <xs:enumeration value="blah_5"/>
    </xs:restriction>
</xs:simpleType>


<xs:simpleType name="another_blah_type">
    <xs:restriction base="xs:string">
        <xs:enumeration value="another_blah_1"/>
        <xs:enumeration value="another_blah_2"/>
        <xs:enumeration value="another_blah_3"/>
        <xs:enumeration value="another_blah_4"/>
        <xs:enumeration value="another_blah_5"/>
    </xs:restriction>
</xs:simpleType>
Run Code Online (Sandbox Code Playgroud)

这些产生了生成的类.在模式C中,与这些枚举对应的类不断重新生成,当然也在错误的位置.我正在以这种方式添加对现有类的引用:(jaxb-creating-modules-for-reuse)

<jaxb:bindings  node="//xs:simpleType[@name='blah_type']">
    <jaxb:class ref="com.stuff.otherstuff.really.deep.BlahType"/>
</jaxb:bindings>
Run Code Online (Sandbox Code Playgroud)

我有其他类型(complexTypes和非枚举simpleTypes)一切都很好.

谢谢你的帮助.