public class ConstantPoolUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
addConstantClassInfo(ClassFile classFile,
String className,
int sizeDelta)
Add a ConstantClassInfo constant pool entry to the
constant pool of a ClassFile.
|
static int |
addConstantFieldrefInfo(ClassFile classFile,
String className,
String fieldName,
String fieldType,
int sizeDelta)
Add a ConstantFieldRef constant pool entry to the constant pool
of a ClassFile.
|
static int |
addConstantMethodrefInfo(ClassFile classFile,
String className,
String methodName,
String methodSignature,
int sizeDelta)
Add a ConstantMethodRef constant pool entry to the constant pool
of a ClassFile.
|
static int |
addConstantNameAndTypeInfo(ClassFile classFile,
String name,
String descriptor,
int sizeDelta)
Add a ConstantNameAndTypeInfo constant pool entry to the
constant pool of a ClassFile.
|
static int |
addConstantPoolEntry(ClassFile classFile,
CPInfo newEntry,
int sizeDelta)
Add a constant pool entry to the
constant pool of a ClassFile.
|
static int |
addConstantUTF8Info(ClassFile classFile,
String string,
int sizeDelta)
Add a ConstantUTF8Info constant pool entry to the
constant pool of a ClassFile.
|
public static int addConstantMethodrefInfo(ClassFile classFile, String className, String methodName, String methodSignature, int sizeDelta)
classFile
- the class file whose constant pool is to be editedclassName
- the name of the referenced classmethodName
- the name of the referenced methodmethodSignature
- the signature of the referenced methodsizeDelta
- the minimum increment by which the array holding the
constant pool is to be enlarged. Set to 0 if unsure.public static int addConstantFieldrefInfo(ClassFile classFile, String className, String fieldName, String fieldType, int sizeDelta)
classFile
- the class file whose constant pool is to be editedclassName
- the name of the referenced classfieldName
- the name of the referenced fieldfieldType
- the type of the referenced fieldsizeDelta
- the minimum increment by which the array holding the
constant pool is to be enlarged. Set to 0 if unsure.public static int addConstantNameAndTypeInfo(ClassFile classFile, String name, String descriptor, int sizeDelta)
classFile
- the class file whose constant pool is to be editedname
- the namedescriptor
- the descriptorsizeDelta
- the minimum increment by which the array holding the
constant pool is to be enlarged. Set to 0 if unsure.public static int addConstantClassInfo(ClassFile classFile, String className, int sizeDelta)
classFile
- the class file whose constant pool is to be editedclassName
- the name of the referenced classsizeDelta
- the minimum increment by which the array holding the
constant pool is to be enlarged. Set to 0 if unsure.public static int addConstantUTF8Info(ClassFile classFile, String string, int sizeDelta)
classFile
- the class file whose constant pool is to be editedstring
- the stringsizeDelta
- the minimum increment by which the array holding the
constant pool is to be enlarged. Set to 0 if unsure.public static int addConstantPoolEntry(ClassFile classFile, CPInfo newEntry, int sizeDelta)
classFile
- the class file whose constant pool is to be editednewEntry
- the new constant pool entrysizeDelta
- the minimum increment by which the array holding the
constant pool is to be enlarged. Set to 0 if unsure.