public class ConstantPoolEditor extends Object
| Constructor and Description |
|---|
ConstantPoolEditor(ProgramClass targetClass)
Creates a new ConstantPoolEditor that will edit constants in the given
target class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addClassConstant(Clazz referencedClass)
Finds or creates a ClassConstant constant pool entry for the given class.
|
int |
addClassConstant(String name,
Clazz referencedClass)
Finds or creates a ClassConstant constant pool entry with the given name.
|
int |
addConstant(Constant constant)
Adds a given constant pool entry to the end of the constant pool/
|
int |
addDoubleConstant(double value)
Finds or creates a DoubleConstant constant pool entry with the given
value.
|
int |
addFieldrefConstant(Clazz referencedClass,
Member referencedMember)
Finds or creates a FieldrefConstant constant pool entry for the given
class and field.
|
int |
addFieldrefConstant(int classIndex,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
Finds or creates a FieldrefConstant constant pool entry with the given
class constant pool entry index and name and type constant pool entry
index.
|
int |
addFieldrefConstant(int classIndex,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
Finds or creates a FieldrefConstant constant pool entry with the given
class constant pool entry index, field name, and descriptor.
|
int |
addFieldrefConstant(String className,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
Finds or creates a FieldrefConstant constant pool entry with the given
class name, field name, and descriptor.
|
int |
addFieldrefConstant(String className,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
Finds or creates a FieldrefConstant constant pool entry with the given
class name, field name, and descriptor.
|
int |
addFloatConstant(float value)
Finds or creates a FloatConstant constant pool entry with the given
value.
|
int |
addIntegerConstant(int value)
Finds or creates a IntegerConstant constant pool entry with the given
value.
|
int |
addInterfaceMethodrefConstant(Clazz referencedClass,
Member referencedMember)
Finds or creates a InterfaceMethodrefConstant constant pool entry for the
given class and method.
|
int |
addInterfaceMethodrefConstant(int classIndex,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
Finds or creates a InterfaceMethodrefConstant constant pool entry with the
given class constant pool entry index and name and type constant pool
entry index.
|
int |
addInterfaceMethodrefConstant(int classIndex,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
Finds or creates a InterfaceMethodrefConstant constant pool entry with the
given class constant pool entry index, method name, and descriptor.
|
int |
addInterfaceMethodrefConstant(String className,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
Finds or creates a InterfaceMethodrefConstant constant pool entry with the
given class name, method name, and descriptor.
|
int |
addInterfaceMethodrefConstant(String className,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
Finds or creates a InterfaceMethodrefConstant constant pool entry with the
given class name, method name, and descriptor.
|
int |
addInvokeDynamicConstant(int bootstrapMethodIndex,
int nameAndTypeIndex,
Clazz[] referencedClasses)
Finds or creates a InvokeDynamicConstant constant pool entry with the given
class constant pool entry index and name and type constant pool entry
index.
|
int |
addInvokeDynamicConstant(int bootstrapMethodIndex,
String name,
String descriptor,
Clazz[] referencedClasses)
Finds or creates a InvokeDynamicConstant constant pool entry with the
given bootstrap method constant pool entry index, method name, and
descriptor.
|
int |
addLongConstant(long value)
Finds or creates a LongConstant constant pool entry with the given value.
|
int |
addMethodHandleConstant(int referenceKind,
int referenceIndex)
Finds or creates a MethodHandleConstant constant pool entry of the
specified kind and with the given field ref, interface method ref,
or method ref constant pool entry index.
|
int |
addMethodrefConstant(Clazz referencedClass,
Member referencedMember)
Finds or creates a MethodrefConstant constant pool entry for the given
class and method.
|
int |
addMethodrefConstant(int classIndex,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
Finds or creates a MethodrefConstant constant pool entry with the given
class constant pool entry index and name and type constant pool entry
index.
|
int |
addMethodrefConstant(int classIndex,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
Finds or creates a MethodrefConstant constant pool entry with the given
class constant pool entry index, method name, and descriptor.
|
int |
addMethodrefConstant(String className,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
Finds or creates a MethodrefConstant constant pool entry with the given
class name, method name, and descriptor.
|
int |
addMethodrefConstant(String className,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
Finds or creates a MethodrefConstant constant pool entry with the given
class name, method name, and descriptor.
|
int |
addMethodTypeConstant(String type)
Finds or creates a MethodTypeConstant constant pool entry with the given
type.
|
int |
addNameAndTypeConstant(String name,
String type)
Finds or creates a NameAndTypeConstant constant pool entry with the given
name and type.
|
int |
addStringConstant(String string,
Clazz referencedClass,
Member referencedMember)
Finds or creates a StringConstant constant pool entry with the given
value.
|
int |
addUtf8Constant(String string)
Finds or creates a Utf8Constant constant pool entry for the given string.
|
public ConstantPoolEditor(ProgramClass targetClass)
public int addIntegerConstant(int value)
public int addLongConstant(long value)
public int addFloatConstant(float value)
public int addDoubleConstant(double value)
public int addStringConstant(String string, Clazz referencedClass, Member referencedMember)
public int addInvokeDynamicConstant(int bootstrapMethodIndex,
String name,
String descriptor,
Clazz[] referencedClasses)
public int addInvokeDynamicConstant(int bootstrapMethodIndex,
int nameAndTypeIndex,
Clazz[] referencedClasses)
public int addMethodHandleConstant(int referenceKind,
int referenceIndex)
public int addFieldrefConstant(Clazz referencedClass, Member referencedMember)
public int addFieldrefConstant(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember)
public int addFieldrefConstant(String className, int nameAndTypeIndex, Clazz referencedClass, Member referencedMember)
public int addFieldrefConstant(int classIndex,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
public int addFieldrefConstant(int classIndex,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
public int addInterfaceMethodrefConstant(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember)
public int addInterfaceMethodrefConstant(String className, int nameAndTypeIndex, Clazz referencedClass, Member referencedMember)
public int addInterfaceMethodrefConstant(Clazz referencedClass, Member referencedMember)
public int addInterfaceMethodrefConstant(int classIndex,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
public int addInterfaceMethodrefConstant(int classIndex,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
public int addMethodrefConstant(Clazz referencedClass, Member referencedMember)
public int addMethodrefConstant(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember)
public int addMethodrefConstant(String className, int nameAndTypeIndex, Clazz referencedClass, Member referencedMember)
public int addMethodrefConstant(int classIndex,
String name,
String descriptor,
Clazz referencedClass,
Member referencedMember)
public int addMethodrefConstant(int classIndex,
int nameAndTypeIndex,
Clazz referencedClass,
Member referencedMember)
public int addClassConstant(Clazz referencedClass)
public int addClassConstant(String name, Clazz referencedClass)
public int addMethodTypeConstant(String type)
public int addNameAndTypeConstant(String name, String type)
public int addUtf8Constant(String string)
public int addConstant(Constant constant)
Copyright © 2015. All Rights Reserved.