Class ElementValuesEditor

java.lang.Object
proguard.classfile.editor.ElementValuesEditor

public class ElementValuesEditor extends Object
This class can add and delete element values to and from a given target annotation default attribute, annotation, or array element value. Element values to be added must be filled out beforehand, including their references to the constant pool.
  • Constructor Details

    • ElementValuesEditor

      public ElementValuesEditor(ProgramClass targetClass, Annotation targetAnnotation, boolean replaceElementValues)
      Creates a new ElementValuesEditor that will edit element values in the given target annotation.
    • ElementValuesEditor

      public ElementValuesEditor(ProgramClass targetClass, ArrayElementValue targetArrayElementValue, boolean replaceElementValues)
      Creates a new ElementValuesEditor that will edit element values in the given target array element value.
  • Method Details

    • addElementValue

      public void addElementValue(ElementValue elementValue)
      Adds the given elementValue to the target.
    • deleteElementValue

      public void deleteElementValue(String elementValueMethodName)
      Deletes the given elementValue to the target.