commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LOX <dimi...@blue-edge.bg>
Subject [betwixt] how to write a collection of heterogenous objects
Date Thu, 19 Jun 2003 14:49:38 GMT
Hi all,

Currently I have a class which holds a hierarchy of composite beans.
There are two kinds of  beans LeafBean and BranchBean. Both of them 
inherit from NodeBean.
The BranchBean holds some data and a collection of NodeBeans. The 
LeafBean contains only primitive data.

When I write the structure using BeanWriter, Betwixt writes all the 
beans as "node", since this is the name of the property of the 
BranchBean. The problem is that when I try to read the resulting XML, 
the BeanReader cannot determine unambiguosly which node corresponds to 
what object.

What I imagine is to have Betwixt write different tags for the different 
kinds of objects in the collection, but it seems impossible so far.

Any ideas?

Regards,
Dimiter


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


Mime
View raw message