Copying JavaBeans Instances: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:


=Object.clone()=
=Object.clone()=
This method can be used when we have access to the JavaBeans instance class code.


=BeanUtils=
=BeanUtils=


<tt>org.apache.commons.beanutils.BeanUtils</tt> is a utility method for populating JavaBeans properties via reflection.
<tt>org.apache.commons.beanutils.BeanUtils</tt> is a utility method for populating JavaBeans properties via reflection.

Revision as of 19:41, 15 October 2018

External

Internal

Overview

This article describes methods of copying Java Bean instances in such a way that changing the copy leaves the original object intact.

Object.clone()

This method can be used when we have access to the JavaBeans instance class code.

BeanUtils

org.apache.commons.beanutils.BeanUtils is a utility method for populating JavaBeans properties via reflection.