commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heiko Seeberger<heiko.seeber...@daybyday.de>
Subject [PATCH] for Bug 11168 (XML-based rules def. for Digester ignores call-param-rule)
Date Thu, 25 Jul 2002 12:50:24 GMT
I attatched the fixed source file DigesterRuleParser.

There were two places to patch the code:

1. Method addRuleInstances
The following lines have to be added:
        digester.addFactoryCreate("*/call-method-rule", new CallMethodRuleFactory());
        digester.addRule("*/call-method-rule", new PatternRule(digester, "pattern"));
        digester.addSetNext("*/call-method-rule", "add", ruleClassName);

2. Inner class CallParamRuleFactory
The inner class CallParamRuleFactory has to be patched like this (formerly was obviously copied
and pasted from CallMethodRuleFactory):
    protected class CallParamRuleFactory extends AbstractObjectCreationFactory {
        public Object createObject(Attributes attributes) {
            int paramNumber = Integer.parseInt(attributes.getValue("paramnumber"));
            String attributeName = attributes.getValue("attrname");
            Rule callParamRule = new CallParamRule(targetDigester, paramNumber, 
                attributeName);
            return callParamRule;
        }
    }

Heiko
Mime
View raw message