commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthijs Wensveen <...@wanadoo.nl>
Subject Re: [digester] RFE - Digester.startElement could use a callback
Date Fri, 17 Oct 2003 07:43:51 GMT
Simon Kitching wrote:

>Hi Steve,
>
>I had a thought yesterday: if you want to trap cases where match returns
>no elements, then you can write a custom Rules class which delegates to
>RulesBase (or whichever), but has a custom match() rule which checks for
>empty lists being returned from the "real" Rules object. Hope this
>helps...
>  
>

Yes, of course, problem solved, I should think :)

>Matthijs:
>The case Steve is interested in is not considered an error by Digester.
>When Digester notices that no rules match a particular element, it just
>logs a DEBUG level message for information, then continues processing.
>Throwing an exception would cause processing to terminate - definitely
>not what is wanted here in most cases.
>

I humbly apologize. I thought that runtime (unchecked) exceptions would 
not cause processing to terminate, but of course this is wrong.

> Steve suggested essentially
>making the behaviour *configurable* by the user in this situation which
>is not a bad idea, but is probably going to be declined because there
>are other ways to achieve this goal, and because very few users of
>digester care about detecting elements with no associated rules.
>  
>

Configurability is always a good thing :)
Some sort of event could be fired, like SAXEvent. But as you said 
subclassing the Rules class is a more pragmatic solution in this case.

Regards,
Matthijs.

PS. Can I get my 2 eurocents back then? :)


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message