|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tomcat.util.bcel.classfile.ConstantPool
public class ConstantPool
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. Those interested in generating constant pools programatically should see ConstantPoolGen.
Constant
,
Serialized FormMethod Summary | |
---|---|
String |
constantToString(Constant c)
Resolve constant to a string representation. |
String |
constantToString(int index,
byte tag)
Retrieve constant at `index' from constant pool and resolve it to a string representation. |
Constant |
getConstant(int index)
Get constant from constant pool. |
Constant |
getConstant(int index,
byte tag)
Get constant from constant pool and check whether it has the expected type. |
String |
getConstantString(int index,
byte tag)
Get string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects. |
int |
getLength()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String constantToString(Constant c) throws ClassFormatException
c
- Constant to be printed
ClassFormatException
public String constantToString(int index, byte tag) throws ClassFormatException
index
- of constant in constant pooltag
- expected type
ClassFormatException
public Constant getConstant(int index)
index
- Index in constant pool
Constant
public Constant getConstant(int index, byte tag) throws ClassFormatException
index
- Index in constant pooltag
- Tag of expected constant, i.e., its type
ClassFormatException
Constant
public String getConstantString(int index, byte tag) throws ClassFormatException
index
- Index in constant pooltag
- Tag of expected constant, either ConstantClass or ConstantString
ClassFormatException
ConstantClass
,
ConstantString
public int getLength()
public String toString()
toString
in class Object
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |