commons-dev mailing list archives

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

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:
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:
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.




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

View raw message