Невозможно создать класс перечисления через XJC - PullRequest
0 голосов
/ 28 марта 2019

У меня есть тег XSD:

<xs:complexType name="ifExpression">
        <xs:annotation>
            <xs:documentation>Boolean logic depending on expressions</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="variableName" type="xs:string"/>
            <xs:element name="operation">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="eq"/>
                        <xs:enumeration value="ne"/>
                        <xs:enumeration value="gt"/>
                        <xs:enumeration value="lt"/>
                        <xs:enumeration value="ge"/>
                        <xs:enumeration value="le"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element name="value" type="tet:valueType"/>
        </xs:sequence>
    </xs:complexType>

У меня есть файл привязки:

<jxb:bindings schemaLocation="Selector.xsd">
        <jxb:bindings node="//xsd:element[@name='ifExpression']/xsd:sequence/xsd:element[@name='operation']">
            <jxb:typesafeEnumClass name="Operation" />
        </jxb:bindings>
    </jxb:bindings>

У меня есть глобальные привязки:

<jxb:globalBindings generateIsSetMethod="true" enableJavaNamingConventions="true" underscoreBinding="asCharInWord" typesafeEnumMemberName="generateName" typesafeEnumBase="xsd:string" fixedAttributeAsConstantProperty="true" />

Теперь, когда я запускаю mvn clean install, я получаю следующую ошибку:

com.sun.istack.SAXParseException2: compiler was unable to honor this enum customization. It is attached to a wrong place, or its inconsistent with other bindings.
    at com.sun.tools.xjc.ErrorReceiver.error (ErrorReceiver.java:86)
    at com.sun.tools.xjc.reader.xmlschema.ErrorReporter.error (ErrorReporter.java:84)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check (UnusedCustomizationChecker.java:150)
.
.
.
com.sun.istack.SAXParseException2: (the above customization is attached to the following location in the schema)
    at com.sun.tools.xjc.ErrorReceiver.error (ErrorReceiver.java:86)
    at com.sun.tools.xjc.reader.xmlschema.ErrorReporter.error (ErrorReporter.java:84)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check (UnusedCustomizationChecker.java:155)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.check (UnusedCustomizationChecker.java:128)
    at com.sun.tools.xjc.reader.xmlschema.UnusedCustomizationChecker.elementDecl (UnusedCustomizationChecker.java:233)

Просто хотел узнать, я что-то не так делаю в пути в файле привязки?Или я совершенно не на том пути?

...