aspose file tools*
The moose likes Java in General and the fly likes copying bean properties values to another bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "copying bean properties values to another bean" Watch "copying bean properties values to another bean" New topic
Author

copying bean properties values to another bean

kishore mang
Greenhorn

Joined: Nov 27, 2012
Posts: 10
Hi All,

For copying one bean properties to another bean apache provided BeanUtils can use, but the condition is
both beans properties signature should match.
But most of the time beans fields signatures(naming) can be different between layers(service, dao etc).

Is there any API which can copy one bean properties to another bean even though field names different?

Best example is castor mapping file where eventhough request xml fields names are different still we can process(map)
request data to xml.

Regards
Kishore
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14266
    
  21

I think you can do this with Dozer.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
kishore mang
Greenhorn

Joined: Nov 27, 2012
Posts: 10
thank you Jesper de Jong for providing solution!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: copying bean properties values to another bean