Package org.datanucleus.enhancer.methods
Class Clone
- java.lang.Object
-
- org.datanucleus.enhancer.ClassMethod
-
- org.datanucleus.enhancer.methods.Clone
-
public class Clone extends ClassMethod
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Method to add the contents of the method.static ClonegetInstance(ClassEnhancer enhancer)-
Methods inherited from class org.datanucleus.enhancer.ClassMethod
close, equals, getAccess, getClassEnhancer, getDescriptor, getMethodAdditionMessage, getName, getNamer, hashCode, initialise, initialise
-
-
-
-
Constructor Detail
-
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 Detail
-
getInstance
public static Clone getInstance(ClassEnhancer enhancer)
-
execute
public void execute()
Method to add the contents of the method.- Specified by:
executein classClassMethod
-
-