commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <james_strac...@yahoo.co.uk>
Subject Re: [Betwixt] Maps
Date Mon, 07 Apr 2003 17:30:57 GMT

On Monday, April 7, 2003, at 05:33 PM, robert burrell donkin wrote:

> can anyone remember if there is a way to read map entries using 
> betwixt?


I'm not sure if reading Maps is supported yet; AFAIK we've not 
auto-defaulted the digester rules for that.

Though writing of Maps is supported. e.g. if you run the TestBeanWriter 
JUnit test case you should see a bean created with a Map property and 
it should write it out as a series of nested <entry> elements.


> if not, then i'm going to add one. would supporting methods such as 
> addFoo(
> Object key, <SingularType> value) sound reasonable?

Sounds great. I guess the key could be any type; so if someone wanted 
to do...

addFoo(String key, <SingularType> value)

that could be supported too.


>
> - robert
>
> On Wednesday, April 2, 2003, at 04:57 AM, Kevin O'Neill wrote:
>
>> What method signatures are required to make Maps work?
>>
>> I have:
>>
>> public Map getPairs()
>> {
>> 	return _beanPairs;
>> }
>>
>> public void setPairs(Map pairMap)
>> {
>> 	_beanPairs = pairMap;
>> }
>>
>> public void addPair(String key, SimpleBean bean)
>> {
>> 	_beanPairs.put(key, bean);
>> }
>>
>> The map gets written, but never read. I've tried a few different
>> approaches with no success.
>>
>> Any help would be great.
>>
>> -k.
>>
>> --
>> If you don't test then your code is only a collection of bugs which
>> apparently behave like a working program.
>>
>> Website: http://www.rocketred.com.au/blogs/kevin/
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

James
-------
http://radio.weblogs.com/0112098/


Mime
View raw message