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

Implementation for multiple Patterns with own base-restriction-simple… #60

Closed CrEaK closed 6 years ago

CrEaK commented 7 years ago

The additional pattern in a simpletype-base restriction was 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 before my changes it looked like this:

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

Fix for issue #61

CrEaK commented 6 years ago

@krasa can you please have a look at my changes? :)