Class VariableEditor

  • All Implemented Interfaces:
    AttributeVisitor

    public class VariableEditor
    extends java.lang.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 Detail

      • VariableEditor

        public VariableEditor()
    • Method Detail

      • 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