다음과 같이 나는 XSD에서 열거 있습니다JAXB 바인딩 파일 : 정수 ID로 열거
public enum Status {
ACTIVE(1),
INACTIVE(2);
private final int statusId;
Status(int statusId) {
this.statusId = statusId;
}
public int getId() {
return this.statusId
}
public static Status getStatusById(int id) {
// iterate through all status and return it
}
}
:이 스키마와 JAXB 바인딩 파일을 사용하여
<xsd:simpleType name="Status">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ACTIVE"/>
<xsd:enumeration value="INACTIVE"/>
</xsd:restriction>
</xsd:simpleType>
, 나는이 유사 열거를 생성 할
위의 Java enum을 얻기 위해 JAXB 바인딩 코드를 찾으려고합니다. 감사.