is there a way to get comments from XSD to Java code using wsimport? For example, I have an XSD file
<!-- Enumerace /model/user/UserLevel.java -->
<xs:simpleType name="userLevel">
<xs:restriction base="xs:string">
<!-- basic user -->
<xs:enumeration value="BASE"/>
<!-- team leader -->
<xs:enumeration value="TL"/>
<!-- section leader -->
<xs:enumeration value="SL"/>
</xs:restriction>
</xs:simpleType>
and I want my generated java enum class to look something like this:
@XmlType(name = "userLevel")
@XmlEnum
public enum UserLevel {
/**
* basic user
*/
BASE,
/**
* team leader
*/
TL,
/**
* section leader
*/
SL;
}
Is this even possible in contract first (eg. java code generated from XSD)?
Ok, I found a solution, this in XSD:
produces a Java enum such as:
The only problem is that xs:documentation does not ignore whitespace so there is a lot of blank space in the comments.