commons-user mailing list archives

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

> What I end up back is a TreeMap containing the value of the ITEM@name as
> 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.

Wendy Smoak

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

View raw message