> OK that's easy to answer :-)
I'm not sure it answers the behavior I saw....
> ifHasMethod checks current class to see if a method with the specified
> name exists, it's not dependent on forAllMethod (it's not like a
> hypothetical ifCurrentMethodNameEquals). So you loop over all methods
> (which also traverses the superclass) and check n times for a method
> called setValue and there's only one setValue method found obviously!
Well, the hardcoded "setValue" is a trivial example, and the end goal is to
really loop over all methods and then template something for each setter,
but handle other methods as well.
> <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.
> 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! :)
> 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.
> 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.
I'll take another look at it later today. Thanks for the quick replies!
Erik
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user