commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject RE: [digester] include in xmlrules
Date Thu, 17 Feb 2005 05:58:03 GMT
On Wed, 2005-02-16 at 11:54 -0800, Gogineni, Pratima wrote:
> On examining the stack I think I found the problem:
> In my rule creator:  digester.addRule("f", rule); should actually be
> digester.addRule("/f", rule);
> i.e. I need to have the path separator as well.
> Which means the Example given in the JavaDoc also needs to be corrected

Could you please confirm this? It sure looks to me like the javadoc
correctly reflects what the code is doing.

DigesterRuleParser has a nested class RulesPrefixAdapter, which is the
object that the custom addRules method actually adds its rules to. This
class overrides the Rules.add method to transparently prepend the
current match prefix when rules are added. And this method does:

        public void add(String pattern, Rule rule) {
            StringBuffer buffer = new StringBuffer();
            if (!pattern.startsWith("/")) {
            delegate.add(buffer.toString(), rule);

So in your example, it looks to me like the rule is added with a pattern
regardless of whether you call
   digester.addRule("f", ...);
   digester.addRule("/f", ...);



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message