users@jaxb.java.net

RE: Schema choice/sequence behavior changed from 1.0 to 2.0ea

From: Petteri Stenius <Petteri.Stenius_at_ubisecure.com>
Date: Tue, 14 Mar 2006 09:47:24 +0200

Thanks everybody for your answers! I'm looking forward to the updated
binding mode feature.

Petteri

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Friday, March 10, 2006 2:53 AM
To: users_at_jaxb.dev.java.net
Subject: Re: Schema choice/sequence behavior changed from 1.0 to 2.0ea

Petteri Stenius wrote:
> Has this behavior changed by design? What could I do with JAXB 2.0 to
> create a more accessible interface for E1Type?

I believe this is a correct behavior. I wouldn't say that this is done "by
design", but it's nevertheless a consequence of various design decisions we
made for 2.0.

As for what it means to be backward compatible, FAQ that Malachi mentioned
should have more details. Unfortunately, the generated interface signature
is not always the same, even though we try to make them look similar as much
as possible.


> <complexType name="E1Type">
> <choice>
> <sequence>
> <choice>
> <element ref="my:A1"/>
> <element ref="my:A2"/>
> </choice>
> <element ref="my:C1" minOccurs="0" maxOccurs="unbounded"/>
> </sequence>
> <element ref="my:C1" maxOccurs="unbounded"/>
> </choice>
> </complexType>

I'm actually working on a binding mode in XJC that allows us to bind the
above schema very nicely, like:

class E1Type {
   A1 getA1();
   A2 getA2();
   List<C1> getC1();
   ...
}

I'm really thinking about spending some effort toward next week to get this
nailed, so stay tuned.... (and keep fingers crossed!)

--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com