ProGuard

proguard.classfile.editor
Class ConstantPoolEditor

java.lang.Object
  extended byproguard.classfile.editor.ConstantPoolEditor

public class ConstantPoolEditor
extends Object

This class can add constant pool entries to given class files.


Constructor Summary
ConstantPoolEditor()
           
 
Method Summary
 int addClassCpInfo(ProgramClassFile programClassFile, String name, ClassFile referencedClassFile)
          Finds or creates a ClassCpInfo constant pool entry with the given name, in the given class file.
 int addFieldrefCpInfo(ProgramClassFile programClassFile, int classIndex, String name, String descriptor, ClassFile referencedClassFile, ClassFile[] referencedClassFiles, MemberInfo referencedMemberInfo)
          Finds or creates a FieldrefCpInfo constant pool entry with the given class constant pool entry index, field name, and descriptor, in the given class file.
 int addFieldrefCpInfo(ProgramClassFile programClassFile, String className, String name, String descriptor, ClassFile referencedClassFile, ClassFile[] referencedClassFiles, MemberInfo referencedMemberInfo)
          Finds or creates a FieldrefCpInfo constant pool entry with the given class name, field name, and descriptor, in the given class file.
 int addMethodrefCpInfo(ProgramClassFile programClassFile, int classIndex, String name, String descriptor, ClassFile referencedClassFile, ClassFile[] referencedClassFiles, MemberInfo referencedMemberInfo)
          Finds or creates a MethodrefCpInfo constant pool entry with the given class constant pool entry index, method name, and descriptor, in the given class file.
 int addMethodrefCpInfo(ProgramClassFile programClassFile, String className, String name, String descriptor, ClassFile referencedClassFile, ClassFile[] referencedClassFiles, MemberInfo referencedMemberInfo)
          Finds or creates a MethodrefCpInfo constant pool entry with the given class name, method name, and descriptor, in the given class file.
 int addNameAndTypeCpInfo(ProgramClassFile programClassFile, String name, String type, ClassFile[] referencedClassFiles)
          Finds or creates a NameAndTypeCpInfo constant pool entry with the given name and type, in the given class file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantPoolEditor

public ConstantPoolEditor()
Method Detail

addFieldrefCpInfo

public int addFieldrefCpInfo(ProgramClassFile programClassFile,
                             int classIndex,
                             String name,
                             String descriptor,
                             ClassFile referencedClassFile,
                             ClassFile[] referencedClassFiles,
                             MemberInfo referencedMemberInfo)
Finds or creates a FieldrefCpInfo constant pool entry with the given class constant pool entry index, field name, and descriptor, in the given class file.

Returns:
the constant pool index of the FieldrefCpInfo.

addFieldrefCpInfo

public int addFieldrefCpInfo(ProgramClassFile programClassFile,
                             String className,
                             String name,
                             String descriptor,
                             ClassFile referencedClassFile,
                             ClassFile[] referencedClassFiles,
                             MemberInfo referencedMemberInfo)
Finds or creates a FieldrefCpInfo constant pool entry with the given class name, field name, and descriptor, in the given class file.

Returns:
the constant pool index of the FieldrefCpInfo.

addMethodrefCpInfo

public int addMethodrefCpInfo(ProgramClassFile programClassFile,
                              int classIndex,
                              String name,
                              String descriptor,
                              ClassFile referencedClassFile,
                              ClassFile[] referencedClassFiles,
                              MemberInfo referencedMemberInfo)
Finds or creates a MethodrefCpInfo constant pool entry with the given class constant pool entry index, method name, and descriptor, in the given class file.

Returns:
the constant pool index of the MethodrefCpInfo.

addMethodrefCpInfo

public int addMethodrefCpInfo(ProgramClassFile programClassFile,
                              String className,
                              String name,
                              String descriptor,
                              ClassFile referencedClassFile,
                              ClassFile[] referencedClassFiles,
                              MemberInfo referencedMemberInfo)
Finds or creates a MethodrefCpInfo constant pool entry with the given class name, method name, and descriptor, in the given class file.

Returns:
the constant pool index of the MethodrefCpInfo.

addClassCpInfo

public int addClassCpInfo(ProgramClassFile programClassFile,
                          String name,
                          ClassFile referencedClassFile)
Finds or creates a ClassCpInfo constant pool entry with the given name, in the given class file.

Returns:
the constant pool index of the ClassCpInfo.

addNameAndTypeCpInfo

public int addNameAndTypeCpInfo(ProgramClassFile programClassFile,
                                String name,
                                String type,
                                ClassFile[] referencedClassFiles)
Finds or creates a NameAndTypeCpInfo constant pool entry with the given name and type, in the given class file.

Returns:
the constant pool index of the NameAndTypeCpInfo.

ProGuard