users@jaxb.java.net

Re: Using JAXB Generated Classes as Beans

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 04 Nov 2003 09:09:02 -0800

> This is a very good point. Why *do* the generated beans have so much
> JAXB-specific cruft in them? Shouldn't plain POJOs suffice?

The short answer is because it's not suffice under the current spec.
For example, with:

    <complexType name="abc">
      <sequence>
        <element name="foo" type="int" minOccurs="0"/>
      </
    </

We just generate

    interface Abc {
        int getFoo();
        void setFoo(int);
    }

which won't tell me if foo is present or not.

But I agree that it would be nice if the marshalling/unmarshalling logic
communicates with beans just through the generated interface.


regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net