commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent PETIT" <lpe...@sqli.com>
Subject [BeanUtils] is it possible to copy a whole graph of objects ?
Date Fri, 25 Jul 2003 15:59:23 GMT
Hello,

I'm wandering for hours around this question : is it possible to copy a
graph of objects with a single call from a JavaBean to a DynaBean ?

Say the DynaBean has the DynaProperties for :
String name;
app.Article[] article;

- Is there a way to define getter and setters in a JavaBean, in order to
have the BeanUtils.copyProperties() or PropertyUtils.copyProperties() to
automatically fetch the list of articles in the JavaBean and autopopulating
the DynaBean ?
- maybe the solution is not one of the two methods mentioned above but
another one I missed ?

I have tried to create getters and setters on my JavaBean as:
public Article getArticle(int index);
public void setArticle(int index, Article article);

but of course it is not sufficient, since there is no way for the BeanUtils
to know the size of the underlying article list/array in my JavaBean.

Thanks in advance,


--
Laurent PETIT [SQLI - Lyon] - lpetit@sqli.com

Groupe SQLI - www.sqli.com


Mime
View raw message