jaxb - xjc - reworking generated typesafe enum category members
when compiling following simpletype xjc accumulate (from jaxb package)...
<xs:simpletype name="test">
<xs:annotation>
<xs:appinfo>
<jaxb:typesafeenumclass/>
</xs:appinfo>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="4">
<xs:annotation>
<xs:appinfo>
<jaxb:typesafeenummember name="four"/>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="6">
<xs:annotation>
<xs:appinfo>
<jaxb:typesafeenummember name="six"/>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpletype>
i finish adult following enum java (import statements comments removed)
@xmlenum
public enum exam {
@xmlenumvalue("4")
four("4"),
@xmlenumvalue("6")
six("6");
private final twine value;
test(string v) {
value = v;
}
open twine value() {
relapse value;
}
open stationary exam fromvalue(string v) {
(test c: test.values()) {
(c.value.equals(v)) {
relapse c;
}
}
pitch new illegalargumentexception(v.tostring());
}
}
this accurately i want... solely public twine value()
method. i design slight called public twine getvalue()
according sun's controlling conventions. proceed i simply jsp-page controlling el. i have work proceed around it.
does anybody have any trust offer tweaking xjc gathering some-more useful bulletin getvalue()
method, instead value()
method? i supplement slight something?
p.s. occurred v2.0.3 jaxb. i downloaded latest chronicle v2.1.8 it's same there...
Comments
Post a Comment