commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siddharth Mathur" <>
Subject [Digester] Converting String value of an attribute to array of integers
Date Fri, 17 Feb 2006 23:23:37 GMT
Dear all,

I am trying to use Digester to read my own XML format (shown below) and
convert it to correctly initialized objects. 


<A ID="1" author="Home made">

<B ID="2" author="Apple Inc." depends="1">

[...more entries here]

<C ID="7" author="CT" depends="4,6">


Classes A, B, C are all derived from a parent class which has three
i) ID (integer)
ii) author (String)
iii) depends (array of IDs i.e integers)

Digester makes it very easy to create setter and getter methods and read in
(i) and (ii) above. But how do I modify the default Rule so that the String
value of the "depends" attribute is converted to an array of integers
property? I will be happy to reformat the depends="4,6" part if required. 

I currently use d.addSetProperties("List/A") to read in my other attributes.

Thank you for your time and patience,

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

View raw message