> > <XDtEjbPersistent:forAllPersistentFields not-pk="true">
> >    <XDtMethod:ifHasMethod name="<XDtMethod:setterMethod/>"
> > parameters="<XDtMethod:methodType/>">
> 
> But doesn't this assume that there is a getter?  I'm almost certain it
> does.
> My class has no getters.

forAllPersistentFields does that, loops over all methods, if is getter
and has @ejb:persistent-field then updates currentMethod.

> > We loop over all abstract getter methods here, and lets say come
across
> > int getId() in this loop, we check if a method called setId(int)
exists
> > and generate code for it. Note that setterMethod works because
obviously
> > forAllPersistentFields updates currentMethod pointer in the loop.
> 
> Again, no getters in my case!  :)

That was just an example! :-)

> > AFAIK what you're trying to accomplish is what you described in a
> > previous email, looping over all methods starts with a specific
prefix.
> > Looping over all setter/getter methods is already easy, just do a
> > forAllMethods and check ifIsSetter (don't remember the exact name).
> 
> Ok, where is this "so-called" ifIsSetter?!  I don't see any such thing
in
> MethodTagsHandler.  But please point me in the right direction if I'm
> totally missing something obvious.

Oops, there's a utility method (public static boolean isGetter( String
str )) but not a template tag which works on currentMethod. I'll add it.

> > Certainly there's room for improvement, more generalization for
purposes
> > other than the ones followed by ejbdoclet.
> 
> I still don't think you've explained why ifHasMethod without the
> 'parameters' does not work, and why ifHasMethod with the 'parameters'
> displayed all methods when only a very specific one was requested.  Or
I'm
> really missing something in your explanations.

It's clear imho. Say you have 20 methods, you loop over them, ask
ifHasMethod("setValue") and get 20 true answers since there is a
setValue method, so the ifHasMethod block is evaluated 20 times and
propertyName is executed which looks at currentMethod and tries to strip
set/get away for each of those 20 methods.

Ara.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to