Ok, I found a solution, this is on XSD:
<xs:simpleType name="MyEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="STANDARD">
<xs:annotation>
<xs:documentation>
This is a comment.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
creates a Java enumeration such as:
@XmlType(name = "MyEnum")
@XmlEnum
public enum MyEnum {
STANDARD,
public String value() {
return name();
}
public static MyEnum fromValue(String v) {
return valueOf(v);
}
}
The only problem is that the xs: document documentation does not ignore spaces, so there are many spaces in the comments.
source
share