commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Raeburn" <>
Subject RE: PropertyUtils.copyProperties()
Date Sat, 24 May 2003 10:51:48 GMT
Use BeanUtils.describe() to create a Map of your source bean
Remove the values your don't need from the Map
Use BeanUtils.populate to copy the properties from the Map to your
destination bean.

For example. Assume you have a bean, of type SourceBean and you don't want
to copy a property called 'unwantedProperty'...

  Map tmp = BeanUtils.describe(source);
  DestinationBean dest = new DestinationBean();
  BeanUtils.populate(dest, tmp);

Hope that helps


-----Original Message-----
From: Affan Qureshi []
Sent: May 24, 2003 3:39 AM
Subject: PropertyUtils.copyProperties()

Both BeanUtils.copyProperties() and PropertyUtils.copyProperties() are very
useful functions. Is it possible for me to do selective copying of
properties? I want the method (not) to copy some properties.

Is this possible?


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

View raw message