Package proguard.classfile.editor
Class MemberRemover
- java.lang.Object
-
- proguard.classfile.editor.MemberRemover
-
- All Implemented Interfaces:
ClassVisitor
,MemberVisitor
public class MemberRemover extends java.lang.Object implements ClassVisitor, MemberVisitor
This visitor removes all members it visits in aProgramClass
.It should be used in two steps:
- in the first step, the collection step, all program fields to be removed should be visited.
- in the second step, the removal step, the program class containing the program fields should be visited. This will actually delete all collected fields.
For example, to remove all fields in a program class:
MemberRemover remover = new MemberRemover(); programClass.fieldsAccept(remover); programClass.accept(remover);
-
-
Constructor Summary
Constructors Constructor Description MemberRemover()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
visitAnyClass(Clazz clazz)
Visits any Clazz instance.void
visitAnyMember(Clazz clazz, Member member)
Visits any Member instance.void
visitProgramClass(ProgramClass programClass)
void
visitProgramField(ProgramClass programClass, ProgramField programField)
void
visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
-
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
-
Methods inherited from interface proguard.classfile.visitor.MemberVisitor
visitLibraryField, visitLibraryMember, visitLibraryMethod, visitProgramMember
-
-
-
-
Method Detail
-
visitAnyClass
public void visitAnyClass(Clazz clazz)
Description copied from interface:ClassVisitor
Visits any Clazz instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyClass
in interfaceClassVisitor
-
visitProgramClass
public void visitProgramClass(ProgramClass programClass)
- Specified by:
visitProgramClass
in interfaceClassVisitor
-
visitAnyMember
public void visitAnyMember(Clazz clazz, Member member)
Description copied from interface:MemberVisitor
Visits any Member instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyMember
in interfaceMemberVisitor
-
visitProgramField
public void visitProgramField(ProgramClass programClass, ProgramField programField)
- Specified by:
visitProgramField
in interfaceMemberVisitor
-
visitProgramMethod
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
- Specified by:
visitProgramMethod
in interfaceMemberVisitor
-
-