'JAXB XJC - How to generate classes for xsd simpleType

I'm trying to generate java classes using maven jaxb plugin starting from an xsd schema. Everything is fine. I need just a refinement. Simple types like this in the xsd schema

    <xs:simpleType name="Max350Text">
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
        <xs:maxLength value="350"/>
      </xs:restriction>
    </xs:simpleType>

are mapped as String properties with Bean Validation annotations thanks to the -XJsr303Annotations switch from krasa-jaxb-tools, mantained by fillumina. Is there a way to generate Classes from simpleType instead of properties with validation? Since I need to generate also JSON schema from the generated java classes I don't want in-line restrictions on every single string property but I need a distinct JSON object that defines restrictions for all other referencing ones.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source