commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: digester 2.0 [WAS Re: [digester] [PROPOSAL] More pattern matching flexibility]
Date Wed, 04 Sep 2002 19:30:01 GMT
Hi Robert,

robert burrell donkin wrote:
> On Wednesday, September 4, 2002, at 04:51 PM, Christopher Lenz wrote:
> 
>> After some more fiddling I think we can get this implemented without 
>> breaking binary compatibility. Well, almost: The field Digester.rules 
>> is the only remaining problem. It'd need to be removed or at least 
>> ignored by Digester, both possibly breaking clients who used the field 
>> directly to get/set the Rules instance from a subclass.
> 
> 
> one thing i've been pondering is whether it might be possible to make 
> matcher an abstract class rather than an interface and then make matcher 
> implement rules. if digester extends digester context then a call to the 
> rules match method can be implemented by the matcher superclass and 
> adapted to call the new match method. we could then implement the 
> getRules method by return the matcher.

Actually, the getRules() and setRules() methods work without any 
problems thanks to the adapter classes... only that a level of 
indirection adds some performance overhead.

The *only* problem regarding backwards-compatibility is that the rules 
instance variable would need to be removed or simply ignored by 
Digester. So the only API client affected by these changes would be 
those who don't use the accessor methods to access the rules, but rather 
access it directly.

> (apologies if this is totally left field - it's hard without being able 
> to see your code.)

I'm attaching a patch ;-)

This patch is not intended to be committed to the current CVS of course. 
It's just to let you (and everyone else who's interested) know what I'm 
up to here.

There's some cosmetic stuff which does't contribute to the actual change 
(I do those by reflex ;-)). Also test cases for the adapters are 
missing. And finally, there's no new functionality in term of complex or 
namespace-aware pattern matching included.

-- 
Christopher Lenz
/=/ cmlenz at gmx.de

Mime
View raw message