users@jaxb.java.net

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

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 09 Mar 2006 16:52:47 -0800

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