commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <si...@ecnetwork.co.nz>
Subject Re: Digester question (Hashtables...) <and> CallMethodRule - parameter types
Date Wed, 10 Sep 2003 01:36:57 GMT
On Tue, 2003-09-09 at 18:44, Geronimo Ma. Hernandez wrote:
> Don't know if our solution is elegant, but it works also for the example.xml 
> from Petra.
> We have a similar situation:
> 
> <map name="map1">
> 	<item value="value1" name="name1"/>
> 	<item value="value2" name="name2"/>
> </map>
> 
> with various "named" maps and the value should be an Integer.
> 
> We solved this with an ObjectCreationFactory, which creates the map. 
> As this rule cares about the object-stack in the end-method, we add the map to 
> the parent in the begin()-method of the ObjectCreationFactory (no 
> addSetNext()-call is needed).
> The begin()-method of the ObjectCreationFactory gets the name of the map in 
> the attributes-array (accessible with attributes.getValue("name"); ), so we 
> can use a standard put()-call of a map.

Yep, that looks like a fine idea to me. Wish I had thought of it :-)
This certainly solves Petra's problem [with about 10 lines of code?].

I still think it would be nice for CallMethodRule to be able to target
objects other than top-of-stack, but this approach does reduce the
necessity for it somewhat.

Maybe we somehow need to collect these "design patterns" of Digester
use?

Regards,

Simon


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


Mime
View raw message