Klasse ConstantPool
java.lang.Object
org.aspectj.apache.bcel.classfile.ConstantPool
- Alle implementierten Schnittstellen:
Node
This class represents the constant pool, i.e., a table of constants, of a parsed classfile. It may contain null references, due
to the JVM specification that skips an entry after an 8-byte constant (double, long) entry.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidintaddArrayClass(ArrayType type) intintaddClass(ObjectType type) intaddConstant(Constant c, ConstantPool cp) intaddConstantDynamic(int bootstrapMethodIndex, int constantNameAndTypeIndex) intaddDouble(double d) intaddFieldref(String class_name, String field_name, String signature) intaddFloat(float f) intaddInteger(int n) intaddInterfaceMethodref(String class_name, String method_name, String signature) intaddInvokeDynamic(int bootstrapMethodIndex, int constantNameAndTypeIndex) intaddLong(long l) intaddMethodHandle(byte referenceKind, int referenceIndex) intaddMethodref(String class_name, String method_name, String signature) intaddMethodType(int descriptorIndex) intaddNameAndType(String name, String signature) intintconstantToString(int index) constantToString(int index, byte tag) Resolve constant to a string representation.copy()voiddump(DataOutputStream file) getConstant(int index) getConstant(int index, byte tag) getConstantModule(int index) getConstantPackage(int index) Constant[]getConstantString(int index, byte tag) Get string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects.getConstantString_CONSTANTClass(int index) getConstantUtf8(int index) intgetModuleName(int moduleIndex) getPackageName(int packageIndex) intgetSize()intlookupClass(String classname) intlookupDouble(double d) intlookupFieldref(String searchClassname, String searchFieldname, String searchSignature) intlookupFloat(float f) intlookupInteger(int n) intlookupInterfaceMethodref(String searchClassname, String searchMethodName, String searchSignature) intlookupLong(long l) intlookupMethodref(String searchClassname, String searchMethodName, String searchSignature) intlookupNameAndType(String searchName, String searchTypeSignature) intintlookupUtf8(String string) toString()
-
Konstruktordetails
-
ConstantPool
public ConstantPool() -
ConstantPool
-
-
Methodendetails
-
getSize
public int getSize() -
getConstant
-
getConstant
-
copy
- Gibt zurück:
- deep copy of this constant pool
-
getConstantString
Get string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects. I.e. these classes have an index field that points to another entry of the constant pool of type `ConstantUtf8' which contains the real data.- Parameter:
index- Index in constant pooltag- Tag of expected constant, either ConstantClass or ConstantString- Gibt zurück:
- Contents of string reference
- Löst aus:
ClassFormatException- Siehe auch:
-
constantToString
Resolve constant to a string representation. -
constantToString
-
constantToString
-
accept
-
getConstantPool
-
dump
- Löst aus:
IOException
-
getConstantUtf8
-
getConstantModule
-
getConstantPackage
-
getConstantString_CONSTANTClass
-
getLength
public int getLength() -
toString
-
lookupInteger
public int lookupInteger(int n) -
lookupUtf8
-
lookupClass
-
addUtf8
-
addInteger
public int addInteger(int n) -
addArrayClass
-
addClass
-
addClass
-
addFieldref
-
lookupFieldref
-
addNameAndType
-
lookupNameAndType
-
addFloat
public int addFloat(float f) -
lookupFloat
public int lookupFloat(float f) -
addDouble
public int addDouble(double d) -
lookupDouble
public int lookupDouble(double d) -
addLong
public int addLong(long l) -
lookupString
-
addString
-
lookupLong
public int lookupLong(long l) -
addConstant
-
addMethodHandle
public int addMethodHandle(byte referenceKind, int referenceIndex) -
addMethodType
public int addMethodType(int descriptorIndex) -
addMethodref
-
addInvokeDynamic
public int addInvokeDynamic(int bootstrapMethodIndex, int constantNameAndTypeIndex) -
addConstantDynamic
public int addConstantDynamic(int bootstrapMethodIndex, int constantNameAndTypeIndex) -
addInterfaceMethodref
-
lookupInterfaceMethodref
-
lookupMethodref
-
getFinalConstantPool
-
getModuleName
-
getPackageName
-