Package org.datanucleus.enhancer.methods
Class Clone
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.methods.Clone
Method to generate a default "clone" method, using ASM, that has the effect of nulling the state manager etc.
public Object clone() throws CloneNotSupportedException { MyClass copy = (MyClass) super.clone(); copy.dnFlags = (byte) 0; copy.dnStateManager = null; return copy; }
-
Field Summary
Fields inherited from class org.datanucleus.enhancer.ClassMethod
access, argNames, argTypes, enhancer, exceptions, methodName, returnType, visitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Method to add the contents of the method.static Clone
getInstance
(ClassEnhancer enhancer) Methods inherited from class org.datanucleus.enhancer.ClassMethod
close, equals, getAccess, getClassEnhancer, getDescriptor, getMethodAdditionMessage, getName, getNamer, hashCode, initialise, initialise
-
Constructor Details
-
Clone
public Clone(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames, String[] exceptions) Constructor.- Parameters:
enhancer
- ClassEnhancername
- Name of methodaccess
- Access typereturnType
- Return typeargTypes
- Argument typesargNames
- Argument namesexceptions
- Any exceptions thrown
-
-
Method Details
-
getInstance
-
execute
public void execute()Method to add the contents of the method.- Specified by:
execute
in classClassMethod
-