users@jaxb.java.net

Re: toString() methods on generated classes

From: Hanson Char <hanson.char_at_gmail.com>
Date: Thu, 14 Sep 2006 11:41:26 -0700

>
> If you use The "direct" method to inject String as a code fragment,
> CodeModel can't figure out what classes are used there, so it can't help.
>
> We can't really just let you "add package imports to the beginning of
> the generated class", because until we complete the generation of a
> while compilation unit, we can't really determine what classes can be
> imported and what cannot.


Wouldn't it be nice to let CodeModel "register" some "direct" imports, so
that it can have them appended to the import-set when it's ready to do so ?


> say, commons-lang-toString plugin and/or xstream-toXml plugin?
>

Hmm ... but wouldn't that lead to a plugin proliferation problem ? How
about the alternative of something like commons-lang-plugin or
xstream-plugin, which would be less specific but still imply the stuff being
used. So commons-lang can be used for implementing toString() or hashCode()
or equal, etc., as configured by the plugin user.

Hanson