commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <j...@wendysmoak.com>
Subject Re: Digester Quesion
Date Mon, 07 Feb 2005 20:27:03 GMT
From: "Luke Shannon" lshannon@futurebrand.com

> What I end up back is a TreeMap containing the value of the ITEM@name as
the
> Map key and the value of <ITEM> as the Map value. Things were running
> smoothly until I was told today that some <ITEM> contain a size attribute.
> Example:
>
>  <ITEM DIR="air3.pdf" HEIGHT="-1" NAME="kcfileupload" SIZE="117960"
> STYPE="file" TYPE="upload" WIDTH="1">air3.pdf</ITEM>

Right now you have a Map where the key/value pair is String/String, correct?
And in the example above, you're currently _only_ storing the 'NAME'
attribute, and whatever is in the body of the <ITEM> tag?

Didn't I talk you out of having an 'Item' class last week?  Looks like you
need it again!  If an 'item' has more properties, it seems to me like you'll
need an Item 'bean', with get/set methods for the various properties.

If you create an Item when you see DATA/VERSION/ITEM, then you can use the
Item as the second parameter to 'put' on the TreeMap.  I have an example of
something similar-- it creates an ArrayList of LazyDynaBeans, you should be
able to adapt it to creating a TreeMap of Items.

http://wiki.wendysmoak.com/cgi-bin/wiki.pl?DigesterLazyDynaBean

-- 
Wendy Smoak


---------------------------------------------------------------------
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