Method Summary |
|
public int | addClassInfo(CtClass c) Adds a new CONSTANT_Class_info structure. |
public int | addClassInfo(String qname) Adds a new CONSTANT_Class_info structure.
This also adds a CONSTANT_Utf8_info structure
for storing the class name.
Parameters: qname - a fully-qualified class name(or the JVM-internal representation of that name). |
int | addConstInfoPadding() |
public int | addDoubleInfo(double d) Adds a new CONSTANT_Double_info
structure. |
public int | addFieldrefInfo(int classInfo, String name, String type) Adds a new CONSTANT_Fieldref_info structure.
This also adds a new CONSTANT_NameAndType_info
structure.
Parameters: classInfo - class_index Parameters: name - name_index of CONSTANT_NameAndType_info . Parameters: type - descriptor_index of CONSTANT_NameAndType_info . |
public int | addFieldrefInfo(int classInfo, int nameAndTypeInfo) Adds a new CONSTANT_Fieldref_info structure.
Parameters: classInfo - class_index Parameters: nameAndTypeInfo - name_and_type_index . |
public int | addFloatInfo(float f) Adds a new CONSTANT_Float_info
structure. |
public int | addIntegerInfo(int i) Adds a new CONSTANT_Integer_info
structure. |
public int | addInterfaceMethodrefInfo(int classInfo, String name, String type) Adds a new CONSTANT_InterfaceMethodref_info
structure.
This also adds a new CONSTANT_NameAndType_info
structure.
Parameters: classInfo - class_index Parameters: name - name_index of CONSTANT_NameAndType_info . Parameters: type - descriptor_index of CONSTANT_NameAndType_info . |
public int | addInterfaceMethodrefInfo(int classInfo, int nameAndTypeInfo) Adds a new CONSTANT_InterfaceMethodref_info
structure.
Parameters: classInfo - class_index Parameters: nameAndTypeInfo - name_and_type_index . |
public int | addLongInfo(long l) Adds a new CONSTANT_Long_info
structure. |
public int | addMethodrefInfo(int classInfo, String name, String type) Adds a new CONSTANT_Methodref_info structure.
This also adds a new CONSTANT_NameAndType_info
structure.
Parameters: classInfo - class_index Parameters: name - name_index of CONSTANT_NameAndType_info . Parameters: type - descriptor_index of CONSTANT_NameAndType_info . |
public int | addMethodrefInfo(int classInfo, int nameAndTypeInfo) Adds a new CONSTANT_Methodref_info structure.
Parameters: classInfo - class_index Parameters: nameAndTypeInfo - name_and_type_index . |
public int | addNameAndTypeInfo(String name, String type) Adds a new CONSTANT_NameAndType_info structure. |
public int | addNameAndTypeInfo(int name, int type) Adds a new CONSTANT_NameAndType_info structure. |
public int | addStringInfo(String str) Adds a new CONSTANT_String_info
structure. |
public int | addUtf8Info(String utf8) Adds a new CONSTANT_Utf8_info
structure. |
public int | copy(int n, ConstPool dest, Map classnames) Copies the n-th item in this ConstPool object into the destination
ConstPool object.
The class names that the item refers to are renamed according
to the given map.
Parameters: n - the n-th item Parameters: dest - destination constant pool table Parameters: classnames - the map or null. |
public String | getClassInfo(int index) Reads CONSTANT_Class_info structure
at the given index. |
public String | getClassName() Returns the name of the class using this constant pool table. |
public Set | getClassNames() Get all the class names. |
public double | getDoubleInfo(int index) Reads CONSTANT_Double_info structure
at the given index. |
public int | getFieldrefClass(int index) Reads the class_index field of the
CONSTANT_Fieldref_info structure
at the given index. |
public String | getFieldrefClassName(int index) Reads the class_index field of the
CONSTANT_Fieldref_info structure
at the given index. |
public String | getFieldrefName(int index) Reads the name_index field of the
CONSTANT_NameAndType_info structure
indirectly specified by the given index.
Parameters: index - an index to a CONSTANT_Fieldref_info . |
public int | getFieldrefNameAndType(int index) Reads the name_and_type_index field of the
CONSTANT_Fieldref_info structure
at the given index. |
public String | getFieldrefType(int index) Reads the descriptor_index field of the
CONSTANT_NameAndType_info structure
indirectly specified by the given index.
Parameters: index - an index to a CONSTANT_Fieldref_info . |
public float | getFloatInfo(int index) Reads CONSTANT_Float_info structure
at the given index. |
public int | getIntegerInfo(int index) Reads CONSTANT_Integer_info structure
at the given index. |
public int | getInterfaceMethodrefClass(int index) Reads the class_index field of the
CONSTANT_InterfaceMethodref_info structure
at the given index. |
public String | getInterfaceMethodrefClassName(int index) Reads the class_index field of the
CONSTANT_InterfaceMethodref_info structure
at the given index. |
public String | getInterfaceMethodrefName(int index) Reads the name_index field of the
CONSTANT_NameAndType_info structure
indirectly specified by the given index.
Parameters: index - an index toa CONSTANT_InterfaceMethodref_info . |
public int | getInterfaceMethodrefNameAndType(int index) Reads the name_and_type_index field of the
CONSTANT_InterfaceMethodref_info structure
at the given index. |
public String | getInterfaceMethodrefType(int index) Reads the descriptor_index field of the
CONSTANT_NameAndType_info structure
indirectly specified by the given index.
Parameters: index - an index toa CONSTANT_InterfaceMethodref_info . |
ConstInfo | getItem(int n) |
public Object | getLdcValue(int index) Reads CONSTANT_Integer_info , _Float_info ,
_Long_info , _Double_info , or
_String_info structure. |
public long | getLongInfo(int index) Reads CONSTANT_Long_info structure
at the given index. |
public int | getMethodrefClass(int index) Reads the class_index field of the
CONSTANT_Methodref_info structure
at the given index. |
public String | getMethodrefClassName(int index) Reads the class_index field of the
CONSTANT_Methodref_info structure
at the given index. |
public String | getMethodrefName(int index) Reads the name_index field of the
CONSTANT_NameAndType_info structure
indirectly specified by the given index.
Parameters: index - an index to a CONSTANT_Methodref_info . |
public int | getMethodrefNameAndType(int index) Reads the name_and_type_index field of the
CONSTANT_Methodref_info structure
at the given index. |
public String | getMethodrefType(int index) Reads the descriptor_index field of the
CONSTANT_NameAndType_info structure
indirectly specified by the given index.
Parameters: index - an index to a CONSTANT_Methodref_info . |
public int | getNameAndTypeDescriptor(int index) Reads the descriptor_index field of the
CONSTANT_NameAndType_info structure
at the given index. |
public int | getNameAndTypeName(int index) Reads the name_index field of the
CONSTANT_NameAndType_info structure
at the given index. |
public int | getSize() Returns the number of entries in this table. |
public String | getStringInfo(int index) Reads CONSTANT_String_info structure
at the given index. |
public int | getTag(int index) Returns the tag field of the constant pool table
entry at the given index. |
public int | getThisClassInfo() Returns the index of CONSTANT_Class_info structure
specifying the class using this constant pool table. |
public String | getUtf8Info(int index) Reads CONSTANT_utf8_info structure
at the given index. |
public int | isConstructor(String classname, int index) Determines whether CONSTANT_Methodref_info
structure at the given index represents the constructor
of the given class. |
public int | isMember(String classname, String membername, int index) Determines whether CONSTANT_Methodref_info ,
CONSTANT_Fieldref_info , or
CONSTANT_InterfaceMethodref_info structure
at the given index represents the member with the specified
name and declaring class. |
public void | print() Prints the contents of the constant pool table. |
public void | print(PrintWriter out) Prints the contents of the constant pool table. |
void | prune() |
public void | renameClass(String oldName, String newName) Replaces all occurrences of a class name. |
public void | renameClass(Map classnames) Replaces all occurrences of class names. |
void | setThisClassInfo(int i) |
public void | write(DataOutputStream out) Writes the contents of the constant pool table. |