Class 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 Detail

      • 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 Detail

      • execute

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