commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [digester] warning of unknown elements and attributes
Date Mon, 28 Apr 2003 12:59:18 GMT
On Friday, April 18, 2003, at 09:58 AM, James Strachan wrote:

<snip>

>> the way i'd prefer the no-matching-rules issue to be resolved would be 
>> through a new Rules implementation. this would wrap another Rules 
>> implementation and allow rules to be registered which would be called 
>> when the wrapped implementation returns no matches. i think that this 
>> would be easy to implement (i might even get round to it soonish), be 
>> useful in other situations (as well as validation) and allow the 
>> flexibility to mix-and-match this behaviour with existing Rules 
>> implementations.
>
> Just to check we're on the same page; we could add a method to Rules to 
> get the non-matching rules. Something like
>
> public void addNonMatchingRule(Rule);
> public List getNonMatchingRules();
>
> And these non-matching rules would be fired by digester if no matching 
> rules are found for a certain element.

i've knocked up a class to make the discussions a bit easier.

rather than add an extra method to the Rules interface, i'd rather create 
a new class that wraps an existing implementation and fires non matching 
rules whenever the wrapped implementation returns no matches. i prefer 
this mechanism since it means that we don't have to change the interface 
or the contract for existing Rules implementations.

- robert


Mime
View raw message