commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
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,
      and
  (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:

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-user@jakarta.apache.org&msgNo=410

Anyway, the approach chosen by this patch is as follows:
the three methods
   Rule.begin(Attributes attributes)
   Rule.body(String text)
   Rule.end()
are deprecated, and new variants of those methods are added to the Rule 
class:
   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 
accomplished.

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 gmx.de

Mime
View raw message