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;
 }
 
  • Constructor Details

    • Clone

      public Clone(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames, String[] exceptions)
      Constructor.
      Parameters:
      enhancer - ClassEnhancer
      name - Name of method
      access - Access type
      returnType - Return type
      argTypes - Argument types
      argNames - Argument names
      exceptions - Any exceptions thrown
  • Method Details

    • getInstance

      public static Clone getInstance(ClassEnhancer enhancer)
    • execute

      public void execute()
      Method to add the contents of the method.
      Specified by:
      execute in class ClassMethod