Hi Alberto,

 

The generation of hasXXX is needed by the marshalling framework to check wether or not a primitive has been set.

Indeed we can’t test if the primitive is null or not !!! so instead we use hasXXX method that returns true if a value has been set while unmarshalling an XML Document.

So hasXXX is not created for Z because Z will be mapped to a java.lang.String that is not a java primitive.

 

Arnaud

 

-----Original Message-----
From: Alberto Gattegno [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 26, 2002 8:45 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] SourceGenerator doesn't generate boolean variable for minOccurs attribute...

 

Hi all,

 

I am a newbie with Castor so please be patient with me.

I am using castor 0.9.3 for marshaling data to and from  XML.

 

I have a complex type with a few fields

 

the schema looks more or less like this ( elements actual name are ommited for simplicity's sake)

 

  <xsd:complexType name="Fields">
        <xsd:all>

            <xsd:element name="W" type="xsd:long"/>
            <xsd:element name="X" type="xsd:string"/>
            <xsd:element name="Y" type="xsd:double" minOccurs="0"/>
            <xsd:element name="Z" type="xsd:string" minOccurs="0"/>
        </xsd:all>
 </xsd:complexType>

 

The SourceGenerator creates a boolean value for element Y and one for element W but not for element Z, although element Z has the minOccurs attribute

 

Is this because the Z element is not a number or is this a problem in Castor?

 

Thanks in advance

 

 

 

=============================
Alberto Gattegno
ITG Israel LTD.
Business Park, 11th Floor
      85 Medinat Hayehodim St.
      P.O.BOX 12859
      Herzelya Pituach, Israel 46766
      Main:   +972-9-970-2700
      Direct:  +972-9-970-2709
      Mobile: +972-51-751-466
      Fax:     +972-9-970-2727
      www.itgil.com

=============================

 

Reply via email to