users@jaxb.java.net

Re: hashCode and equals methods in generated classes

From: Hanson Char <hanson.char_at_gmail.com>
Date: Sat, 28 Oct 2006 12:08:32 -0700

Hi Kenny,

Thanks for the suggestion. I'll look into it when I got a chance.

Hanson

On 10/27/06, Kenny MacLeod <kennym_at_kizoom.com> wrote:
> Hi Hanson. May I suggest yet another impertinent enhancement on one of
> your plugins? :-)
>
> In the case of the generated equals method, the plugin could take an
> option parameter in XJC which indicates the static field which is a
> reference to the ToStringStyle you want to use, in a similar way to
> xjc:javaType takes references to print and parse static methods in a
> binding customisation. If the option isn't supplied, then just fallback
> to the default style.
>
> Alternatively, or even additionally, you could generate an additional
> toString() method which takes a ToStringStyle parameter, which would
> allow you to override it at runtime.
>
> The reason I suggest these is that it's notoriously trickly to pick a
> ToStringStyle that works with every object model and every application.
>