I believe that both XSDHelper and XSD2JavaGenerator are not properly
accounting for sequence and read-only indicators in the XSD. I have a test
case which I can attach to the Jira. I'm appending my XSD below because the
problem may lie in my XSD.
If I define the Type with the TypeHelper using
readOnlyProperty.setBoolean("readOnly", true);
and
seqType.setBoolean("sequenced", true);
Then the test case passes.
I created the XSD from my understanding of the 2.1 Spec. (sdo:sequence - p.
84 of 2.1 and sdo:readOnly - pp.107, 108). I'll open a Jira unless
somebody can tell me how I've misunderstood the spec.
The XSD:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="
commonj.sdo" xmlns:simple="http://example.com/ExpectedException"
targetNamespace="http://example.com/ExpectedException">
<xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
<xsd:element name="expectedExceptionsElem"
type="simple:ExpectedExceptionType"/>
<xsd:complexType name="ExpectedExceptionType">
<xsd:sequence>
<xsd:element name="stringVal" type="sdo:String"/>
<xsd:element name="booleanVal" type="sdo:Boolean"/>
<xsd:element name="booleanVal2" type="sdo:Boolean"/>
<xsd:element name="byteVal" type="sdo:Byte"/>
<xsd:element name="stringVal2" type="sdo:String"/>
<xsd:element name="decimalVal" type="sdo:Decimal"/>
<xsd:element name="decimalVal2" type="sdo:Decimal"/>
<xsd:element name="intVal" type="sdo:Int"/>
<xsd:element name="floatVal" type="sdo:Float"/>
<xsd:element name="doubleVal" type="sdo:Double"/>
<xsd:element name="dateVal" type="sdo:Date"/>
<xsd:element name="shortVal" type="sdo:Short"/>
<xsd:element name="longVal" type="sdo:Long"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="listVal"
type="sdo:String"/>
<xsd:element name="bytesVal" type="sdo:Bytes"/>
<xsd:element name="integerVal" type="sdo:Integer"/>
<xsd:element name="charVal" type="sdo:Character"/>
<xsd:element name="readOnlyVal" sdo:readOnly="true"
type="sdo:String"/>
<xsd:element name="readOnlyListVal" sdo:readOnly="true"
type="sdo:String"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="sequencedReadOnlyElem"
type="simple:SequenceReadOnlyType"/>
<xsd:complexType sdo:sequence="true" name="SequenceReadOnlyType">
<xsd:sequence>
<xsd:element name="readOnlyVal" sdo:readOnly="true"
type="sdo:String"/>
<xsd:element name="readOnlyListVal" sdo:readOnly = "true"
type="sdo:String"/>
<xsd:element name="uniqueName" type="sdo:String"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>