commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <>
Subject [digester] [PATCH] Passing namespace URI and name to the Rule methods
Date Wed, 11 Sep 2002 11:28:35 GMT
Hi all,

[this stuff has been discussed before, and here I'm sending a patch to 
push a little ;-)]

The intention of the changes in this patch is to:

  (a) enable processing of namespace information by Rule implementations,
  (b) improve the way Rule implementations get access to the name of the
      matching element

In my opinion, these changes are long overdue, at least since the 
introduction of the ExtendedBaseRules class, but are quite useful even 
when not using that Rules implementation. You'll find an example in a 
second patch that I'm going to send out a bit later. Also, you may want 
to read this message and the associated thread:

Anyway, the approach chosen by this patch is as follows:
the three methods
   Rule.begin(Attributes attributes)
   Rule.body(String text)
are deprecated, and new variants of those methods are added to the Rule 
   Rule.begin(String namespaceURI, String name, Attributes attributes)
   Rule.body(String namespaceURI, String name, String text)
   Rule.end(String namespaceURI, String name)

The default implementation of those new methods delegate to the 
deprecated variant, so that *full backward compatibility* can be 

In the patch, Digester is modified so that it calls the new methods, and 
BeanPropertySetterRule is updated to take advantage of the new methods 
(it needs access to the element name). All other Rule implementations 
are left unchanged, mainly to demonstrate that (let me repeat ;-)) *full 
backwards compatibility* is retained.

Please comment or commit ;-)

Christopher Lenz
/=/ cmlenz at

View raw message