Class MethodCopier

java.lang.Object
proguard.classfile.editor.MethodCopier
All Implemented Interfaces:
AttributeVisitor, ClassVisitor, MemberVisitor

public class MethodCopier extends Object implements ClassVisitor, MemberVisitor, AttributeVisitor
This ClassVisitor copies a method into a target class. It first checks if a method with the same name and descriptor as the method to be copied already exists in the target class. If that is indeed the case, this visitor is a no-op. This visitor optionally uses a name transformer function to apply to the original method's name before copying. If no name transformer function is provided, the original method's name is used, instead. If the method to be copied is indeed copied into the target class, this visitor passes the resulting method to an extra member visitor, if provided.