You're trying to make the same property be both a normal and indexed property. You have to have only one setter and one getter for each property.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 24, 2003 2:25 AM > To: Jakarta Commons Users List > Subject: [BeanUtils] Indexed and mapped properties > > > I define a propertie with its getter and setter indexed in > ObjectA and > ObjectB : > > private Collection voConfList = new ArrayList(); > public Collection getVoConfList() { > return (voConfList); > } > > public String getVoConfList(int index) { > return (String) CollectionUtils.index(voConfList, index); > } > > public void setVoConfList(int index, String value) { > // index ingnore it's just a test > this.voConfList.add(value); > } > > public void setVoConfList(Collection voConfList) { > this.voConfList = voConfList; > } > > And then call copyProperties : > objectB.setVoConfList(0, "value from") > BeanUtils.copyProperties(objectA, objectB); > > The attribut in object is create but empty. The copy is not > done. I have > the same probleme with Map. But when i do same indexed getter > and setter > for an String[] it work. > > I see in the BeanUtils javadoc for copyProperties methode : > "FIXME - Indexed and mapped properties that do not have > getter and setter > methods for the underlying array or Map are not copied by this method" > I define getter and setter so where is the probleme > > Is there an other way to copy Indexed and mapped properties > of an object to an other ? > > Nicolas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
