krasa / krasa-jaxb-tools

XJC / JAXB plugin for generation of Bean Validation Annotations (JSR-303) and replacing primitive types
Apache License 2.0
61 stars 47 forks source link

Multiple Patterns with own base-restriction-simpletype is ignored #61

Closed CrEaK closed 6 years ago

CrEaK commented 7 years ago

The additional pattern in a simpletype-base restriction is ignored in the wsdl2java generation. Example:

<xsd:simpleType name="patternList">
        <xsd:restriction base="a:patternListBase">
            <xsd:pattern value="[0-9]" />
            <xsd:pattern value="[A-B]" />
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="patternListBase">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="[Y-Z]" />
        </xsd:restriction>
    </xsd:simpleType>

The annotation in the java-class should look like this:

@Pattern.List({
        @Pattern(regexp = "[Y-Z]"),
        @Pattern(regexp = "([0-9])|([A-B])")
    })

but looks like this

@Pattern(regexp = "([0-9])|([A-B])")

I already created pull request #60 with the fix :)

krasa commented 6 years ago

Nice, thanks! I released it as 1.7-SNAPSHOT