Package proguard.classfile.visitor
Class MethodCreator
- java.lang.Object
-
- proguard.classfile.visitor.MethodCreator
-
- All Implemented Interfaces:
ClassVisitor
public class MethodCreator extends java.lang.Object implements ClassVisitor
This class visitor is able to create a method and add it to a program class in case it does not exist yet.
-
-
Constructor Summary
Constructors Constructor Description MethodCreator(ClassPool programClassPool, ClassPool libraryClassPool, java.lang.String name, java.lang.String descriptor, int requiredSetAccessFlags, int processingFlags, boolean callSuper)Create a new MethodCreator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddReturnInstructions(InstructionSequenceBuilder builder, java.lang.String returnType)Adds a return instruction to this builder for a super call that resulted in the given return type.ProgramMethodgetMethod()voidvisitAnyClass(Clazz clazz)Visits any Clazz instance.voidvisitProgramClass(ProgramClass programClass)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface proguard.classfile.visitor.ClassVisitor
visitLibraryClass
-
-
-
-
Constructor Detail
-
MethodCreator
public MethodCreator(ClassPool programClassPool, ClassPool libraryClassPool, java.lang.String name, java.lang.String descriptor, int requiredSetAccessFlags, int processingFlags, boolean callSuper)
Create a new MethodCreator.- Parameters:
programClassPool- The program class pool.libraryClassPool- The library class pool.name- The name of the method to add.descriptor- The descriptor of the method to add.requiredSetAccessFlags- The access flags of the method to add.processingFlags- The processing flags to attach to the method.callSuper- Whether the method should call a super method.
-
-
Method Detail
-
visitAnyClass
public void visitAnyClass(Clazz clazz)
Description copied from interface:ClassVisitorVisits any Clazz instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyClassin interfaceClassVisitor
-
visitProgramClass
public void visitProgramClass(ProgramClass programClass)
- Specified by:
visitProgramClassin interfaceClassVisitor
-
addReturnInstructions
public static void addReturnInstructions(InstructionSequenceBuilder builder, java.lang.String returnType)
Adds a return instruction to this builder for a super call that resulted in the given return type.
-
getMethod
public ProgramMethod getMethod()
-
-