org.apache.ojb.otm.copy
Class CloneableObjectCopyStrategy

java.lang.Object
  extended byorg.apache.ojb.otm.copy.CloneableObjectCopyStrategy
All Implemented Interfaces:
ObjectCopyStrategy

public class CloneableObjectCopyStrategy
extends java.lang.Object
implements ObjectCopyStrategy

Author:
matthew.baird

Constructor Summary
CloneableObjectCopyStrategy()
           
 
Method Summary
 java.lang.Object copy(java.lang.Object obj)
          If users want to implement clone on all their objects, we can use this to make copies.
 java.lang.Object copy(java.lang.Object src, java.lang.Object dest)
          copy src object into dest object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloneableObjectCopyStrategy

public CloneableObjectCopyStrategy()
Method Detail

copy

public java.lang.Object copy(java.lang.Object obj)
                      throws ObjectCopyException
If users want to implement clone on all their objects, we can use this to make copies. This is hazardous as user may mess it up, but it is also potentially the fastest way of making a copy. Usually the OjbCloneable interface should just be delegating to the clone() operation that the user has implemented.

Specified by:
copy in interface ObjectCopyStrategy
Parameters:
obj - object to be copied
Returns:
Object the copy of the object
Throws:
ObjectCopyException
See Also:
ObjectCopyStrategy.copy(Object)

copy

public java.lang.Object copy(java.lang.Object src,
                             java.lang.Object dest)
Description copied from interface: ObjectCopyStrategy
copy src object into dest object

Specified by:
copy in interface ObjectCopyStrategy
Parameters:
src -
dest -
Returns:


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14