Problem for me is to implement clone for an object. This object A has it's members object B, which were not created by A. I want to clone A such that only object's created during construction of A to be cloned. The objects which were either passed as reference in A or A's objects or A's object's object not to be cloned. They should only be referenced.
Is this possible? I have gone through some deep cloning libraries source(deep - cloner) , seems the can't make the distinction. I can't do serialization de-serialization as I suspect it will not solve my case. Also the object A that I have to clone is very complex. I involves almost all classes in project. Does apache serialization utils takes care of above case ?