Complex type extension, collections, and class creation

View: New views
5 Messages — Rating Filter:   Alert me  

Complex type extension, collections, and class creation

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Castor users,

If one has a schema like [1], and generates Java classes using Castor (Maven plugin), it will among other things produce TFoosNBars class with property fooOrBarList of type java.util.List<FooOrBar>. Is there a way to configure Castor to generate such properties without creating type for collection element (FooOrBar in this case which extends TIdentifiable) but instead to use referenced type directly (TIdentifiable)? I've tried setting org.exolab.castor.builder.javaclassmapping in castorbuilder.properties but neither of the two options (type/element) produced desired output.

Thanks in advance!

Regards,
Stevo.

[1] schema snippet

...
    <xsd:complexType name="TIdentifiable" abstract="true">
        <xsd:sequence>
            <xsd:element name="id" type="xsd:long" />
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="TFoo">
        <xsd:complexContent>
            <xsd:extension base="TIdentifiable">
                <xsd:sequence>
                    <xsd:element name="thefoo" type="xsd:string" />
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="TBar">
        <xsd:complexContent>
            <xsd:extension base="TIdentifiable">
                <xsd:sequence>
                    <xsd:element name="thebar" type="xsd:int" />
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="TFoosNBars">
        <xsd:sequence>
            <xsd:element name="fooOrBar" type="TIdentifiable" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>
...

Re: Complex type extension, collections, and class creation

by jmborer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello castor users,

Can someone explain what CycleBreaker is used for? Appart, from
bugging and creating memory leaks, I don't see its usefulness.

We had problems when moving from 0.9.4 to 1.3.1. So we simply removed
everything related to CycleBreaker in the XML generation and all our
problems are gone...

Cheers,

Jean-Marc

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Complex type extension, collections, and class creation

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jean-Marc Borer,

I don't see how your comment/question relates to my thread.

Please don't steal my thread, create a separate one. Thanks!

Regards,
Stevo.

On Wed, Sep 2, 2009 at 4:57 PM, Jean-Marc Borer <jmborer@...> wrote:
Hello castor users,

Can someone explain what CycleBreaker is used for? Appart, from
bugging and creating memory leaks, I don't see its usefulness.

We had problems when moving from 0.9.4 to 1.3.1. So we simply removed
everything related to CycleBreaker in the XML generation and all our
problems are gone...

Cheers,

Jean-Marc

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: Complex type extension, collections, and class creation

by jmborer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, wrong email manip.

On Wed, Sep 2, 2009 at 3:15 PM, Stevo Slavić<sslavic@...> wrote:

> Jean-Marc Borer,
>
> I don't see how your comment/question relates to my thread.
>
> Please don't steal my thread, create a separate one. Thanks!
>
> Regards,
> Stevo.
>
> On Wed, Sep 2, 2009 at 4:57 PM, Jean-Marc Borer <jmborer@...> wrote:
>>
>> Hello castor users,
>>
>> Can someone explain what CycleBreaker is used for? Appart, from
>> bugging and creating memory leaks, I don't see its usefulness.
>>
>> We had problems when moving from 0.9.4 to 1.3.1. So we simply removed
>> everything related to CycleBreaker in the XML generation and all our
>> problems are gone...
>>
>> Cheers,
>>
>> Jean-Marc
>>
>> ---------------------------------------------------------------------
>> 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



Re: Complex type extension, collections, and class creation

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Castor 1.2 codegen seems to generate too many types, even with org.exolab.castor.builder.javaclassmapping=type (which as I understood is default anyway). If an element of an XSD complex type has a type which has been generated, why then generate wrapper type for the element itself? Hopefully newer versions are better at it.

Regards,
Stevo.

On Wed, Sep 2, 2009 at 5:18 PM, Jean-Marc Borer <jmborer@...> wrote:
Sorry, wrong email manip.

On Wed, Sep 2, 2009 at 3:15 PM, Stevo Slavić<sslavic@...> wrote:
> Jean-Marc Borer,
>
> I don't see how your comment/question relates to my thread.
>
> Please don't steal my thread, create a separate one. Thanks!
>
> Regards,
> Stevo.
>
> On Wed, Sep 2, 2009 at 4:57 PM, Jean-Marc Borer <jmborer@...> wrote:
>>
>> Hello castor users,
>>
>> Can someone explain what CycleBreaker is used for? Appart, from
>> bugging and creating memory leaks, I don't see its usefulness.
>>
>> We had problems when moving from 0.9.4 to 1.3.1. So we simply removed
>> everything related to CycleBreaker in the XML generation and all our
>> problems are gone...
>>
>> Cheers,
>>
>> Jean-Marc
>>
>> ---------------------------------------------------------------------
>> 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