You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Kyrre Lugg <ky...@tomra.no> on 2003/07/11 15:49:02 UTC

[digester] Method return value into the stack

Is it possible to use the return value of a callMethodRule as a param to a 
subsequent callMethodRule?

How can it eventually be done?

Kyrre Lugg


Re: [digester] Method return value into the stack

Posted by Kyrre Lugg <ky...@tomra.no>.
robert burrell donkin wrote:

> i've just added a method into CallMethodRule which is called with the 
> result of the method call. if you upgrade to CVS HEAD (or wait for a new 
> nightly) then you may be able to create a subclass that does what you want.

Ok. Thanx.

Kyrre Lugg


Re: [digester] Method return value into the stack

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Friday, July 11, 2003, at 02:49 PM, Kyrre Lugg wrote:

> Is it possible to use the return value of a callMethodRule as a param to 
> a subsequent callMethodRule?

not at the moment,

> How can it eventually be done?

i've just added a method into CallMethodRule which is called with the 
result of the method call. if you upgrade to CVS HEAD (or wait for a new 
nightly) then you may be able to create a subclass that does what you want.
  (take a look at ObjectParamRule)

there may be a few wrinkles since the call method params are pushed onto a 
stack and so are only available within the subtree rooted at the matched 
element. if you need to share the information between element where one 
does not enclose the other, for example:

<element-one>...</element-one><element-two>...</element-two>

then this will be more difficult. i have some ideas but i'll need to talk 
them through with the other developers.

- robert