commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naresh Bhatia" <>
Subject [Digester] Does <call-param-rule> really work?
Date Thu, 23 Jan 2003 05:05:12 GMT
I don't understand how to make <call-param-rule> work for parsing a
simple set of properties in to a Hashtable. Here's an example of my

    <property name="prop1" value="value1"/>
    <property name="prop2" value="value2"/>

I have tried two approaches to push the parameters on to the stack, but
logger output shows that <call-param-rule> is never fired. Instead
<call-method-rule> is fired and it calls the put( ) method with two

Approach 1:
  <pattern value="property">
    <call-method-rule methodname="put" paramcount="2">
      <call-param-rule param-index="0" attribute-name="name"/>
      <call-param-rule param-index="1" attribute-name="value"/>

Approach 2:
  <pattern value="property">
    <call-param-rule param-index="0" attribute-name="name"/>
    <call-param-rule param-index="1" attribute-name="value"/>
    <call-method-rule methodname="put" paramcount="2"/>

Looking at the DigesterRuleParser source code (release 1.3), I don't see
how <call-param-rule> will ever be called. Note below that
CallParamRuleFactory never returns a CallParamRule - it always returns a

    protected class CallParamRuleFactory extends
AbstractObjectCreationFactory {

        public Object createObject(Attributes attributes) {
            // create callmethodrule
            int paramNumber =
            String methodName = attributes.getValue("attrname");
            Rule callMethodRule = new CallMethodRule(targetDigester,
            return callMethodRule;

Please help

Naresh Bhatia

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message