org.apache.tools.ant.taskdefs.optional.depend.constantpool
public class ConstantPool extends Object
See Also: The Java Virtual
Machine Specification
Constructor Summary | |
---|---|
ConstantPool() Initialise the constant pool. |
Method Summary | |
---|---|
int | addEntry(ConstantPoolEntry entry)
Add an entry to the constant pool.
|
int | getClassEntry(String className)
Get the index of a given CONSTANT_CLASS entry in the constant pool.
|
int | getConstantEntry(Object constantValue)
Get the index of a given constant value entry in the constant pool.
|
ConstantPoolEntry | getEntry(int index)
Get an constant pool entry at a particular index.
|
int | getFieldRefEntry(String fieldClassName, String fieldName, String fieldType)
Get the index of a given CONSTANT_FIELDREF entry in the constant
pool.
|
int | getInterfaceMethodRefEntry(String interfaceMethodClassName, String interfaceMethodName, String interfaceMethodType)
Get the index of a given CONSTANT_INTERFACEMETHODREF entry in the
constant pool.
|
int | getMethodRefEntry(String methodClassName, String methodName, String methodType)
Get the index of a given CONSTANT_METHODREF entry in the constant
pool.
|
int | getNameAndTypeEntry(String name, String type)
Get the index of a given CONSTANT_NAMEANDTYPE entry in the constant
pool.
|
int | getUTF8Entry(String value)
Get the index of a given UTF8 constant pool entry.
|
void | read(DataInputStream classStream)
Read the constant pool from a class input stream.
|
void | resolve()
Resolve the entries in the constant pool. |
int | size()
Get the size of the constant pool.
|
String | toString()
Dump the constant pool to a string.
|
Parameters: entry the new entry to be added to the constant pool.
Returns: the index into the constant pool at which the entry is stored.
Parameters: className the name of the class for which the class entry index is required.
Returns: the index at which the given class entry occurs in the constant pool or -1 if the value does not occur.
Parameters: constantValue the constant value for which the index is required.
Returns: the index at which the given value entry occurs in the constant pool or -1 if the value does not occur.
Parameters: index the index into the constant pool.
Returns: the constant pool entry at that index.
Parameters: fieldClassName the name of the class which contains the field being referenced. fieldName the name of the field being referenced. fieldType the type descriptor of the field being referenced.
Returns: the index at which the given field ref entry occurs in the constant pool or -1 if the value does not occur.
Parameters: interfaceMethodClassName the name of the interface which contains the method being referenced. interfaceMethodName the name of the method being referenced. interfaceMethodType the type descriptor of the method being referenced.
Returns: the index at which the given method ref entry occurs in the constant pool or -1 if the value does not occur.
Parameters: methodClassName the name of the class which contains the method being referenced. methodName the name of the method being referenced. methodType the type descriptor of the method being referenced.
Returns: the index at which the given method ref entry occurs in the constant pool or -1 if the value does not occur.
Parameters: name the name type the type
Returns: the index at which the given NameAndType entry occurs in the constant pool or -1 if the value does not occur.
Parameters: value the string value of the UTF8 entry.
Returns: the index at which the given string occurs in the constant pool or -1 if the value does not occur.
Parameters: classStream the DataInputStream of a class file.
Throws: IOException if there is a problem reading the constant pool from the stream
Returns: the size of the constant pool
Returns: the constant pool entries as strings