Given 2 elements a and b in an XSD file. Both are of type int but the
difference is that a is having minOccurs="0"
while b is not. So now when a Java class is generated out of this XSD, it contains a of type Integer
while b is of type int
. Please explain.
<?xml version="1.0" ?>
<xs:complexType name="SearchAB">
<xs:element name="a" minOccurs="0" type="xs:int">
<xs:annotation>`enter code here`
<xs:documentation>a</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="b" type="xs:int">
<xs:annotation>
<xs:documentation>b</xs:documentation>
</xs:annotation>
</xs:element>"
</xs:complexType>
Java class:
protected Integer a;
protected int b;