Andrus Adamchik <andru..bjectstyle.org> wrote:
> Have you ever looked at XDoclet (http://xdoclet.sourceforge.net/). I
> wonder if it can solve your problems with class generation? I don't see
> how we can take advantage of it in Cayenne (since it requires existing
> Java classes as a context for further class generation), but it seems
> appropriate for the things that you've described.
I've looked at it briefly in the past, but not recently. I seem to recall
it working mostly off of javadoc tags. I will take a look at it again.
My needs (as opposed to wants) for class generation extension are actually
quite simple. The ability to do some basic string operations (capitalize,
uncapitalize, strip package names) either via built-ins or via extension,
and the ability to specify the destination file name. Actually, even the
destination file name could be hacked around by renaming each generated file
in an ant task, although that would be quite painful.
I think the proper extensible solution is to add velocity toolbox support so
that any user can specify additional tool classes to be added into the
context. However, that will require distributing the velocity-tools
package in addition to velocity. The advantages are that it already
provides excellent generic tools for math operations, date formatting and
number formatting among others.
http://jakarta.apache.org/velocity/tools/index.html
This archive was generated by hypermail 2.0.0 : Tue Feb 03 2004 - 14:01:53 EST