commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject [digester] new rule SetNestedPropertiesRule
Date Mon, 17 Nov 2003 09:32:18 GMT

Attached is a rule which behaves like a cross between SetPropertiesRule
and BeanPropertySetterRule-with-trailing-wildcard-match.


digester.addRule("point", new SetNestedPropertiesRule());

Note that the rule doesn't need to use ExtendedBaseRules with trailing
wildcard (which is very powerful but not very efficient). It is
configured with the pattern matching the "parent" element.

The implementation uses a trick developed for the plugins module:
inserting a "decorator" Rules object that performs custom matching to
detect the direct child elements.

Yes, this functionality can already be achieved with Digester, but this
is pretty efficient and convenient, and this configuration pattern is a
common one.




View raw message