users@jaxb.java.net

Re: Use of jaxb:class/_at_implClass

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 10 Sep 2003 12:06:07 -0700

> > The implClass customization is not intended to have you implement the
> > class from scratch. It's rather to have you derive your own class from
> > what's produced from the RI.
> >
> > So you should leave those methods untouched.
>
> But that's not what the xjc seems to generate. I have the schema below.
> This generates (as I had expected) a class called MyClassImpl, which is
> extending net.sf.jaxme.test.misc.jaxb.impl.SomeClass.

What you are doing in your schema is that you are specifying your
impl class for your anonymous complex type, which is supposed to be
deriving from MyClassTypeImpl.

So the compiler is trying to create the following relationship

    MyClassImpl -> (your) SomeClass -> SomeClass (which is usually
    generated as MyClassTypeImpl but you changed i by class/_at_name.)

If your customization would have been:

    <jaxb:class implClass="***.SomeClass" />

Then you will get:

    MyClassImpl -> (your) SomeClass -> MyClassTypeImpl

If you want to change the implClass of element, attach your annotation
to the element.

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