XSDスキーマにフィールドがありました:
<xs:element name="magicField">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:totalDigits value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Java クラスでは、フィールドが生成されました。
int magicField;
しかし、その後、xsd スキーマは次のように変更されました。
<xs:element name="magicField">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="int_code">
<xs:totalDigits value="8"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
ここで「int_code」:
<xs:complexType name="int_code">
<xs:simpleContent>
<xs:extension base="xs:positiveInteger">
<xs:attribute name="name"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
また、JAXB は次のコードを生成します。
MagicField magicField;
および MagicField.java が追加されています。
しかし、私はまだ必要です
int magicField;
生成されたコードで。
属性「名前」はまったく使用されません。
スキーマを変更できません。バインド ファイル (xjb) のみを使用しています。
「int_code」タイプを再マップし、「magicField」をint
complexType (コード内) ではなく simpleType (コード内)として取得するバインディングを作成するにはどうすればよいmagicField
ですか?
私が理解しているように、バインディング ルールだけでなく、カスタム XmlAdapter も必要です。
前もって感謝します。