proguard.classfile.editor
Class AttributesEditor

java.lang.Object
  extended by proguard.classfile.editor.AttributesEditor

public class AttributesEditor
extends java.lang.Object

This class can add and delete attributes to and from classes, fields, methods, and code attributes. Attributes to be added must be filled out beforehand, including their references to the constant pool. Existing attributes of the same type are always replaced.


Constructor Summary
AttributesEditor()
           
 
Method Summary
 void addAttribute(ProgramClass programClass, Attribute attribute)
          Adds the given attribute to the given class.
 void addAttribute(ProgramClass programClass, ProgramField programField, Attribute attribute)
          Adds the given attribute to the given field.
 void addAttribute(ProgramClass programClass, ProgramMethod programMethod, Attribute attribute)
          Adds the given attribute to the given method.
 void addAttribute(ProgramClass programClass, ProgramMethod programMethod, CodeAttribute codeAttribute, Attribute attribute)
          Adds the given attribute to the given code attribute.
 void deleteAttribute(ProgramClass programClass, ProgramField programField, java.lang.String attributeName)
          Deletes the given attribute from the given field.
 void deleteAttribute(ProgramClass programClass, ProgramMethod programMethod, CodeAttribute codeAttribute, java.lang.String attributeName)
          Deletes the given attribute from the given code attribute.
 void deleteAttribute(ProgramClass programClass, ProgramMethod programMethod, java.lang.String attributeName)
          Deletes the given attribute from the given method.
 void deleteAttribute(ProgramClass programClass, java.lang.String attributeName)
          Deletes the given attribute from the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesEditor

public AttributesEditor()
Method Detail

addAttribute

public void addAttribute(ProgramClass programClass,
                         Attribute attribute)
Adds the given attribute to the given class.


addAttribute

public void addAttribute(ProgramClass programClass,
                         ProgramField programField,
                         Attribute attribute)
Adds the given attribute to the given field.


addAttribute

public void addAttribute(ProgramClass programClass,
                         ProgramMethod programMethod,
                         Attribute attribute)
Adds the given attribute to the given method.


addAttribute

public void addAttribute(ProgramClass programClass,
                         ProgramMethod programMethod,
                         CodeAttribute codeAttribute,
                         Attribute attribute)
Adds the given attribute to the given code attribute.


deleteAttribute

public void deleteAttribute(ProgramClass programClass,
                            java.lang.String attributeName)
Deletes the given attribute from the given class.


deleteAttribute

public void deleteAttribute(ProgramClass programClass,
                            ProgramField programField,
                            java.lang.String attributeName)
Deletes the given attribute from the given field.


deleteAttribute

public void deleteAttribute(ProgramClass programClass,
                            ProgramMethod programMethod,
                            java.lang.String attributeName)
Deletes the given attribute from the given method.


deleteAttribute

public void deleteAttribute(ProgramClass programClass,
                            ProgramMethod programMethod,
                            CodeAttribute codeAttribute,
                            java.lang.String attributeName)
Deletes the given attribute from the given code attribute.