J'ai des problèmes pour appliquer des liaisons d'héritage xjb à un simpleType. L'appliquer à un complexType semble fonctionner correctement.Le plugin d'héritage pour JAXB2 ne fonctionne pas sur les types simples
L'erreur que je reçois est:
compiler was unable to honor this implements customization. It is attached to a wrong place, or its inconsistent with other bindings.
Mes fixations ressemblent à ceci:
<jaxb:bindings version="1.0"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
jaxb:extensionBindingPrefixes="xjc">
<jaxb:bindings schemaLocation="../xsd/schema.xsd" node="/xs:schema">
<jaxb:bindings multiple="true"
node="//xs:complexType[substring(@name, string-length(@name)-string-length('-e')+1)='-e']">
<inheritance:implements>mypackage.Element</inheritance:implements>
</jaxb:bindings>
<jaxb:bindings multiple="true"
node="//xs:simpleType[descendant::xs:restriction[@base='string']]">
<inheritance:implements>mypackage.Element</inheritance:implements>
</jaxb:bindings>
</jaxb:bindings>
Et mon xsd contient les lignes suivantes:
<simpleType name="checkOut">
<restriction base="string"/>
</simpleType>
<simpleType name="checkIn">
<restriction base="string"/>
</simpleType>
<complexType name="Author-e"></complexType>
Par conséquent, toute tentative de appliquer ce plugin/modification à un simpleType échoue. Les types simples ne sont-ils pas pris en charge par le plugin d'héritage?