commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: [Digester] Is capability to set object property based on attribute value comparison present?
Date Thu, 03 Feb 2005 04:33:26 GMT
On Wed, 2005-02-02 at 17:50 -0600, Kartik Asatkar wrote:
> Hi,
> This is regarding Digester v1.6
> Is it possible to set an object property with value taken from body or
> a particular attribute based on comparison of another attribute value
> (this needs to be specified in the xml rule file)?
> Something like -
>     - if attribute X value matches Y then set parameter N to body of element
>     - if attribute X value matches Y then set parameter N to value of
> attribute Z

No such functionality is built in to digester. However it wouldn't be
too hard to write a custom Rule to do this. Writing custom Rule classes
is really pretty easy....

> I need to be able to do this in the xml rule file?

Accessing custom rule classes from xmlrules is complicated. In addition
to creating your Rule, you need to subclass the
class to add a factory that can instantiate and configure your rule.



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

View raw message