Package javassist.bytecode
Class ClassFileWriter.ConstPoolWriter
java.lang.Object
javassist.bytecode.ClassFileWriter.ConstPoolWriter
- Enclosing class:
ClassFileWriter
Constant Pool.
-
Method Summary
Modifier and TypeMethodDescriptionint
addClassInfo
(int name) Adds a newCONSTANT_Class_info
structure.int
addClassInfo
(String jvmname) Adds a newCONSTANT_Class_info
structure.int[]
addClassInfo
(String[] classNames) MakesCONSTANT_Class_info
objects for each class name.int
addDoubleInfo
(double d) Adds a newCONSTANT_Double_info
structure.int
addDynamicInfo
(int bootstrap, int nameAndTypeInfo) Adds a newCONSTANT_Dynamic_info
structure.int
addFieldrefInfo
(int classInfo, int nameAndTypeInfo) Adds a newCONSTANT_Fieldref_info
structure.int
addFloatInfo
(float f) Adds a newCONSTANT_Float_info
structure.int
addIntegerInfo
(int i) Adds a newCONSTANT_Integer_info
structure.int
addInterfaceMethodrefInfo
(int classInfo, int nameAndTypeInfo) Adds a newCONSTANT_InterfaceMethodref_info
structure.int
addInvokeDynamicInfo
(int bootstrap, int nameAndTypeInfo) Adds a newCONSTANT_InvokeDynamic_info
structure.int
addLongInfo
(long l) Adds a newCONSTANT_Long_info
structure.int
addMethodHandleInfo
(int kind, int index) Adds a newCONSTANT_MethodHandle_info
structure.int
addMethodrefInfo
(int classInfo, int nameAndTypeInfo) Adds a newCONSTANT_Methodref_info
structure.int
addMethodTypeInfo
(int desc) Adds a newCONSTANT_MethodType_info
structure.int
addNameAndTypeInfo
(int name, int type) Adds a newCONSTANT_NameAndType_info
structure.int
addNameAndTypeInfo
(String name, String type) Adds a newCONSTANT_NameAndType_info
structure.int
addStringInfo
(String str) Adds a newCONSTANT_String_info
structure.int
addUtf8Info
(String utf8) Adds a newCONSTANT_Utf8_info
structure.
-
Method Details
-
addClassInfo
MakesCONSTANT_Class_info
objects for each class name.- Returns:
- an array of indexes indicating
CONSTANT_Class_info
s.
-
addClassInfo
Adds a newCONSTANT_Class_info
structure.This also adds a
CONSTANT_Utf8_info
structure for storing the class name.- Parameters:
jvmname
- the JVM-internal representation of a class name. e.g.java/lang/Object
.- Returns:
- the index of the added entry.
-
addClassInfo
public int addClassInfo(int name) Adds a newCONSTANT_Class_info
structure.- Parameters:
name
-name_index
- Returns:
- the index of the added entry.
-
addNameAndTypeInfo
Adds a newCONSTANT_NameAndType_info
structure.- Parameters:
name
-name_index
type
-descriptor_index
- Returns:
- the index of the added entry.
-
addNameAndTypeInfo
public int addNameAndTypeInfo(int name, int type) Adds a newCONSTANT_NameAndType_info
structure.- Parameters:
name
-name_index
type
-descriptor_index
- Returns:
- the index of the added entry.
-
addFieldrefInfo
public int addFieldrefInfo(int classInfo, int nameAndTypeInfo) Adds a newCONSTANT_Fieldref_info
structure.- Parameters:
classInfo
-class_index
nameAndTypeInfo
-name_and_type_index
.- Returns:
- the index of the added entry.
-
addMethodrefInfo
public int addMethodrefInfo(int classInfo, int nameAndTypeInfo) Adds a newCONSTANT_Methodref_info
structure.- Parameters:
classInfo
-class_index
nameAndTypeInfo
-name_and_type_index
.- Returns:
- the index of the added entry.
-
addInterfaceMethodrefInfo
public int addInterfaceMethodrefInfo(int classInfo, int nameAndTypeInfo) Adds a newCONSTANT_InterfaceMethodref_info
structure.- Parameters:
classInfo
-class_index
nameAndTypeInfo
-name_and_type_index
.- Returns:
- the index of the added entry.
-
addMethodHandleInfo
public int addMethodHandleInfo(int kind, int index) Adds a newCONSTANT_MethodHandle_info
structure.- Parameters:
kind
-reference_kind
such as
.REF_invokeStatic
index
-reference_index
.- Returns:
- the index of the added entry.
- Since:
- 3.17.1
-
addMethodTypeInfo
public int addMethodTypeInfo(int desc) Adds a newCONSTANT_MethodType_info
structure.- Parameters:
desc
-descriptor_index
.- Returns:
- the index of the added entry.
- Since:
- 3.17.1
-
addInvokeDynamicInfo
public int addInvokeDynamicInfo(int bootstrap, int nameAndTypeInfo) Adds a newCONSTANT_InvokeDynamic_info
structure.- Parameters:
bootstrap
-bootstrap_method_attr_index
.nameAndTypeInfo
-name_and_type_index
.- Returns:
- the index of the added entry.
- Since:
- 3.17.1
-
addDynamicInfo
public int addDynamicInfo(int bootstrap, int nameAndTypeInfo) Adds a newCONSTANT_Dynamic_info
structure.- Parameters:
bootstrap
-bootstrap_method_attr_index
.nameAndTypeInfo
-name_and_type_index
.- Returns:
- the index of the added entry.
- Since:
- 3.26
-
addStringInfo
Adds a newCONSTANT_String_info
structure.This also adds a new
CONSTANT_Utf8_info
structure.- Returns:
- the index of the added entry.
-
addIntegerInfo
public int addIntegerInfo(int i) Adds a newCONSTANT_Integer_info
structure.- Returns:
- the index of the added entry.
-
addFloatInfo
public int addFloatInfo(float f) Adds a newCONSTANT_Float_info
structure.- Returns:
- the index of the added entry.
-
addLongInfo
public int addLongInfo(long l) Adds a newCONSTANT_Long_info
structure.- Returns:
- the index of the added entry.
-
addDoubleInfo
public int addDoubleInfo(double d) Adds a newCONSTANT_Double_info
structure.- Returns:
- the index of the added entry.
-
addUtf8Info
Adds a newCONSTANT_Utf8_info
structure.- Returns:
- the index of the added entry.
-