Class VariableEditor

java.lang.Object
proguard.classfile.editor.VariableEditor
All Implemented Interfaces:
AttributeVisitor

public class VariableEditor extends Object implements AttributeVisitor
This AttributeVisitor accumulates specified changes to local variables, and then applies these accumulated changes to the code attributes that it visits.
  • Constructor Details

    • VariableEditor

      public VariableEditor()
  • Method Details

    • reset

      public void reset(int maxLocals)
      Resets the accumulated code changes.
      Parameters:
      maxLocals - the length of the local variable frame that will be edited next.
    • deleteVariable

      public void deleteVariable(int variableIndex)
      Remembers to delete the given variable.
      Parameters:
      variableIndex - the index of the variable to be deleted.
    • isDeleted

      public boolean isDeleted(int instructionOffset)
      Returns whether the given variable at the given offset will be deleted.
    • visitAnyAttribute

      public void visitAnyAttribute(Clazz clazz, Attribute attribute)
      Description copied from interface: AttributeVisitor
      Visits any Attribute instance. The more specific default implementations of this interface delegate to this method.
      Specified by:
      visitAnyAttribute in interface AttributeVisitor
    • visitCodeAttribute

      public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
      Specified by:
      visitCodeAttribute in interface AttributeVisitor