commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg McCreath <greg.mccre...@intellect.be>
Subject RE: Digester SetNext rule and Interfaces ...
Date Fri, 05 Apr 2002 11:33:25 GMT
Robert,

Fantastic.  Many thanks for your clear reply.  I'll try em both.

Greg.

-----Original Message-----
From: robert burrell donkin [mailto:robertdonkin@mac.com]
Sent: 05 April 2002 11:30
To: Jakarta Commons Developers List
Subject: Re: Digester SetNext rule and Interfaces ...


hi greg

digester's behaviour has recently been enhanced in this area. i'll discuss 
the older stuff first but i'll come back to the enhancements before the 
end.

SetNextRule (and other rules like it) has two different usage patterns.

1. you can pass in just a method name and digester will try to find a 
method with the given name that accepts a parameter matching the object's 
type.

2. you can specify the method name and the class name of the parameter 
type - in this case digester will try to find a method with the given name 
matching the given parameter type.

if you use option 2 and specify an interface name as the parameter name, i 
expect digester to find the method correctly.

that's the old way to do what you want - specifying the class name of the 
interface that the method takes.


the CVS HEAD version of digester contains extra code (relying on the 
latest version of beanutils) which finds a lot more automagic matches. 
hopefully, if your method takes an interface implemented by the object to 
be passed in then that method will now be found using case 1. in other 
words, if you upgrade to the latest beanutils and digester source then 
your problem might go away.

hope this helps.

- robert

On Friday, April 5, 2002, at 09:12 AM, Greg McCreath wrote:

>
> Hi all,
>
> I'm beavering away with Digester and have a question.  The SetNext rule
> takes sends a method to the top-but-one object on the stock passing as a
> parameter the top object.  It is looking for a method signature that uses
> the top object class as a parameter ... but ... what if the method 
> signature
> is expecting an interface and not a specific class?  Digester seems to not
> cater for this.  Am I correct?  Is there a workaround?
>
> Many thanks
>
> Greg.
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>
>


--
To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message