Class MemberRemover

  • All Implemented Interfaces:
    ClassVisitor, MemberVisitor

    public class MemberRemover
    extends java.lang.Object
    implements ClassVisitor, MemberVisitor
    This visitor removes all members it visits in a ProgramClass.

    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);