users@jaxb.java.net

Discovered difference between JAXB 1.0 and beta

From: Les Hazlewood <les_at_hazlewood.com>
Date: Sat, 17 May 2003 00:30:38 +0100

Hiya everyone,

I was hoping someone could help me out a little...I suspect the answer is
fairly easy, and my question is not complicated...

In JAXB beta, I could define an XSD segment (purely bogus example):

<!-- namespace stuff all here...
    for this example I'll use the targetNamespace as "cars"
 -->

<element name="car">
   <complexType>
       <attribute name="vin" type="string"/>
   </complexType>
</element>

<element name="garage">
   <complexType>
       <sequence>
           <element ref="cars:car" minOccurs="1" maxOccurs="1"/>
       </sequence>
   </complexType>
</element>


All this compiles in xjc just fine.

When I try to unmarshal, I could do:

Garage garage =
    (Garage)u.unmarshal(new FileInputStream(_carsXmlInstanceFile));

Everything is still fine.

In JAXB beta, I could do:
Car car = garage.getCar();

Now, I can't do that....

Instead, with JAXB 1.0 in the JWSDP, I have to do:

CarType car = garage.getCar();

I HATE this. Its incredibly unintuitive. Conceptually, I want to operate
on a CAR, not on a CarType.

I know the difference between the two in JAXB 1.0 and how they're used.

Is there a way to make JAXB do this instead???:
Car car = garage.getCar();

where the method signature for JAXB's generated getCar() is:
my.package.name.Car getCar();

Can't I just do what beta used to do (and made sense)?

Thanks so much for any help.

Les
<still weening off of JAXB beta>