commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <si...@ecnetwork.co.nz>
Subject [digester] PathCallParamRule
Date Tue, 02 Mar 2004 21:09:22 GMT
Hi,

I think we need a CallParamRule variant which saves the matching tagname
as a method call parameter. This mail was prompted by a user question
about building a HashMap using this kind of data:
  <item>
    <foo>1</foo>
    <bar>2</bar>
  </item>
where the tagnames within an item are not known in advance.

There is in CVS a new class PathCallParamRule which passes the whole
path. I suggest that we add a flag to this method to pass just the
tagname rather than the whole path. Alternatively, we could have a
completely separate rule for just the tag name. 

On the subject of CallParamRule variants: they are getting a little
messy now. 

I suggest that we adopt a naming standard of:
 CallParamWithXXXRule
for all call-param-rule variants, so that it is easier for users to find
the available param rules. This would mean renaming PathCallParamRule to
CallParamWithPathRule. I would also suggest creating a
CallParamWithObjectRule which is a copy of ObjectCallParamRule, and
marking ObjectCallParamRule as deprecated.

Or even more alternatively, we could roll all existing param-related
rule functionality into the CallParamRule, and have a constructor which
takes some enum-like flag to say which behaviour we want:
  digester.addCallParam(pattern, CallParamRule.TAGNAME, 0);
  digester.addCallParam(pattern, CallParamRule.ATTR, 0);
  digester.addCallParam(pattern, CallParamRule.BODY, 0);
  digester.addCallParam(pattern, CallParamRule.MATCHPATH, 0);

This would clean up the existing CallParamRule constructor API, which
has grown rather ugly as features have been added.


Thoughts?

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message