<xs:element name="age">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="120"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
So I want it to get converted to Java code like this:
public void setAge(int age){
if(age < 0 || age > 120){
//throw some exception
}
//setting the age as it is a valid value
}
Is it possible in JAXB?
Had seen some WebService Client stub generator doing this maybe axis2 webservice but not sure.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…