commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: [digester] Enhancing CallMethodRule to take target offset
Date Sun, 15 Feb 2004 22:24:46 GMT
hi simon

the ideas look fine to me.

i (and most likely craig as well) will (in true jakarta tradition) pay  
attention to reviewing your commits (for the first few at least) so  
look out for any replies. :)

- robert

On 11 Feb 2004, at 22:56, Simon Kitching wrote:

> Hi,
> As discussed on the user list, there appears to be a need to make calls
> on objects other than the top-of-stack in a manner more flexible than
> the limited SetNextRule and SetRootRule.
> Attached is a patch which adds a "targetOffset" attribute to the
> CallMethodRule to indicate which object on the digester stack gets
> invoked. The default value for the offset is 0, which is the old
> behaviour for CallMethodRule (invoke method on top object).
> If this is ok, I can commit this myself [first use of new apache commit
> rights - yay!]
> Notes:
> (a) the test case uses SetNestedPropertiesRule. When factory methods  
> for
> this new rule were added to Digester, the main usage (no constructor
> params) was omitted, so attached is a minor patch to fix this.
> (b) several new constructors were added to CallMethodRule each taking  
> an
> int targetOffset as a first param. Selecting the target seems the
> *first* thing to do, hence makes sense to me to make it the first
> param..
> (c) In CallMethodRule, if target object for call is found to be null, a
> deliberate exception with a useful message is now thrown rather than
> throwing a NullPointerException. I used a SAXException as I couldn't  
> see
> anything more appropriate. Alternate suggestions welcome.
> (d) I haven't added factory methods on Digester for the new
> CallMethodRule constructors. This usage isn't wildly common, so I'm not
> sure the factory methods are really needed. We can always add them  
> later
> anyway.
> Regards,
> Simon
> <><><CallMethodRuleTestCase

> .java.patch>----------------------------------------------------------- 
> ----------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message