----- Original Message -----
From: "Ara Abrahamian" <[EMAIL PROTECTED]>

> > 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.

But I'm not processing EJB either!  :)

Just a plain ol' bean class.

> 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.

Ah ha!

Thanks.

> > 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.

Ok, I understand this, and realize that my example was slightly flawed
because of the forAllMethods confusing things.  Sorry for that.  Lets go
back to this:

  <XDtMethod:ifHasMethod name="setValue">
        without parameters
  </XDtMethod:ifHasMethod>

  <XDtMethod:ifHasMethod name="setValue" parameters="java.lang.String">
    with parameters
  </XDtMethod:ifHasMethod>

All I get generated is "with parameters".  That is not what the
documentation says about ifHasMethod:

"Evaluate the body if current class has a method with the specified
name+parameters. If parameters not specified then any method with the given
name and any set of parameters is considered equal to the given method name
and so the test result is positive and the body is evaluated. This method
does not change the current method to the one specified."

Clearly I have a setValue method - so why doesn't the first ifHasMethod pick
it up?  Shouldn't it?

I tried replacing the first 'ifHasMethod' with 'setCurrentMethod' and it
still did not get picked up.

*arg* - got a simple explanation for this one?!  :)

    Erik



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

Reply via email to