【发布时间】:2011-07-27 08:55:17
【问题描述】:
我在阻止类重新生成时遇到了麻烦。我是
我有一个架构 A,它被导入到架构 B 中。然后架构 B 被导入到架构 C 中。
在模式 A 中,我有两个 simpleType,它们是字符串的枚举:
<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>
论文生成生成的类。在模式 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>
我还有其他类型(complexTypes 和非枚举 simpleTypes),一切都很好。
感谢您的帮助。
【问题讨论】: