I don't remember this top of my head, but Castor will generate more than one 
getter for a given member (especially if you ask for this to be done via the 
builder configuration property file). In other words, there should be another 
getter that returns the actual List instance.

 

Werner

 

________________________________

Von: Sébastien PERES-LABOURDETTE - Public [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 02. April 2007 12:02
An: [email protected]
Betreff: Re: AW: AW: [castor-user] Castor Xsd -> Jdo mapping

 

I have it generated all right as arrayLists :

>From construcror :
...
        this._blList = new java.util.ArrayList<com.omerin.nc.jdo.Bl>();
...

But the generated "getter" returns an array[], and not a collection (ArrayList).

???

Werner Guttmann a écrit : 

Interesting. You are supplying a '-types arraylist' parameter already .. ;-). 
Iow, you should be getting Collection classes (namely java.util.(Array)List) 
already in your generated sources.
 
Hmm ...
Werner
 
________________________________________
Von: Sébastien PERES-LABOURDETTE - Public [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 02. April 2007 11:40
An: [email protected]
Betreff: Re: AW: [castor-user] Castor Xsd -> Jdo mapping
 
>From sample source gen ".bat".
 
%JAVA% -cp %CP% org.exolab.castor.builder.SourceGeneratorMain -dest 
d:\java\dev\ofc -i %1.xsd -package %2 -f -types arraylist -type-factory 
arraylist -verbose
 
Is that correct ?
 
(JDK-1.6 / Castor-1.1)
 
Werner Guttmann a écrit : 
What tool are you using to start source code generation ? Ant ? Maven ? 
 
Werner
 
  
-----Ursprüngliche Nachricht-----
Von: Sébastien PERES-LABOURDETTE - Public [mailto:sebastien.peres-
[EMAIL PROTECTED]
Gesendet: Montag, 02. April 2007 10:28
An: Castor User
Betreff: [castor-user] Castor Xsd -> Jdo mapping
 
Hi.
 
I have an xsd file containing an element :
 
    <xs:element name="ncf">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="bl" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="nature" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
             ......
 
SourceGenerator generates a getter :
 
    public com.omerin.nc.jdo.Bl[] getBl() {
        com.omerin.nc.jdo.Bl[] array = new com.omerin.nc.jdo.Bl[0];
        return (com.omerin.nc.jdo.Bl[]) this._blList.toArray(array);
    }
 
This getter returns an array, is there a way to make it return an
arrayList ?
 
Thanks
 
--
Sébastien PERES-LABOURDETTE
 
---------------------------------------------------------------------
To unsubscribe from this list please visit:
 
    http://xircles.codehaus.org/manage_email
    
 
 
---------------------------------------------------------------------
To unsubscribe from this list please visit:
 
    http://xircles.codehaus.org/manage_email
 
 
 
  
 
  

 

-- 
Sébastien PERES-LABOURDETTE

Reply via email to