users@jaxb.java.net

RE: Re: Disable generating getter method

From: <HeruMartinus.Salim_at_infineon.com>
Date: Mon, 30 Oct 2006 08:42:08 +0100

Thanks Kohsuke,

Problem about this co-variant return type is solved, but I think it
doesn't work for returning the List of co-variant types.
I didn't get what you mean by out-of-box option. Is there then any way
to do this? Using in-the-box option? (sorry if I miss-using the term).

Regards,
Heru

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Friday, October 27, 2006 7:34 PM
To: users_at_jaxb.dev.java.net
Subject: Re: Disable generating getter method

HeruMartinus.Salim_at_infineon.com wrote:
> I had a problem that my generated codes have a getter methods which
> returning of the type of the generated classes (which is normal).
> And now I'm making a wrapper of these classes (which is the
> subclasses), I have problem while I must returning the classes of the
> wrappers. But when I try to override the getter methods, there are
> compile error that I cannot return different type when overriding.

JDK5 supports co-variant return type, so you should be able to override
the getter method to return a subtype. Can you cite a relevant portion
of the source code and error message?

> Or should I disable the generating of getter method? How to do it on
> the customization? I've looked to the documentation, but cannot find
> the expected part.

There's no out-of-box option to disable a getter generation, in short of
writing a plugin.

--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com