-
- All Implemented Interfaces:
public class ConstantPoolUtilUtility methods for working on the constant pool of a ClassFile object.
-
-
Field Summary
Fields Modifier and Type Field Description public final static ConstantPoolUtilINSTANCE
-
Method Summary
Modifier and Type Method Description final IntegeraddConstantMethodrefInfo(ClassFile classFile, String className, String methodName, String methodSignature)Add a ConstantMethodrefInfo constant pool entry to the constant pool of a ClassFile. final IntegeraddConstantFieldrefInfo(ClassFile classFile, String className, String fieldName, String fieldType)Add a ConstantFieldrefInfo constant pool entry to the constant pool of a ClassFile. final IntegeraddConstantNameAndTypeInfo(ClassFile classFile, String name, String descriptor)Add a ConstantNameAndTypeInfo constant pool entry to the constant pool of a ClassFile. final IntegeraddConstantClassInfo(ClassFile classFile, String className)Add a ConstantClassInfo constant pool entry to the constant pool of a ClassFile. final IntegeraddConstantPackageInfo(ClassFile classFile, String packageName)Add a ConstantPackageInfo constant pool entry to the constant pool of a ClassFile. final IntegeraddConstantUTF8Info(ClassFile classFile, String string)Add a ConstantUTF8Info constant pool entry to the constant pool of a ClassFile. final IntegeraddConstantPoolEntry(ClassFile classFile, Constant newEntry)Add a constant pool entry to the constant pool of a ClassFile. -
-
Method Detail
-
addConstantMethodrefInfo
final Integer addConstantMethodrefInfo(ClassFile classFile, String className, String methodName, String methodSignature)
Add a ConstantMethodrefInfo constant pool entry to the constant pool of a ClassFile.
- Parameters:
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 method
-
addConstantFieldrefInfo
final Integer addConstantFieldrefInfo(ClassFile classFile, String className, String fieldName, String fieldType)
Add a ConstantFieldrefInfo constant pool entry to the constant pool of a ClassFile.
- Parameters:
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 field
-
addConstantNameAndTypeInfo
final Integer addConstantNameAndTypeInfo(ClassFile classFile, String name, String descriptor)
Add a ConstantNameAndTypeInfo constant pool entry to the constant pool of a ClassFile.
- Parameters:
classFile- the class file whose constant pool is to be editedname- the namedescriptor- the descriptor
-
addConstantClassInfo
final Integer addConstantClassInfo(ClassFile classFile, String className)
Add a ConstantClassInfo constant pool entry to the constant pool of a ClassFile.
- Parameters:
classFile- the class file whose constant pool is to be editedclassName- the name of the referenced class
-
addConstantPackageInfo
final Integer addConstantPackageInfo(ClassFile classFile, String packageName)
Add a ConstantPackageInfo constant pool entry to the constant pool of a ClassFile.
- Parameters:
classFile- the class file whose constant pool is to be editedpackageName- the name of the package
-
addConstantUTF8Info
final Integer addConstantUTF8Info(ClassFile classFile, String string)
Add a ConstantUTF8Info constant pool entry to the constant pool of a ClassFile.
- Parameters:
classFile- the class file whose constant pool is to be editedstring- the string
-
addConstantPoolEntry
final Integer addConstantPoolEntry(ClassFile classFile, Constant newEntry)
Add a constant pool entry to the constant pool of a ClassFile.
- Parameters:
classFile- the class file whose constant pool is to be editednewEntry- the new constant pool entry
-
-
-
-