public class ConstantPool
extends java.lang.Object
Constant| Modifier and Type | Method and Description |
|---|---|
<T extends Constant> |
getConstant(int index)
Gets constant from constant pool.
|
<T extends Constant> |
getConstant(int index,
byte tag)
Gets constant from constant pool and check whether it has the expected type.
|
<T extends Constant> |
getConstant(int index,
java.lang.Class<T> castTo)
Gets constant from constant pool.
|
ConstantInteger |
getConstantInteger(int index)
Gets constant from constant pool and check whether it has the expected type.
|
ConstantUtf8 |
getConstantUtf8(int index)
Gets constant from constant pool and check whether it has the expected type.
|
public <T extends Constant> T getConstant(int index) throws ClassFormatException
T - A Constant subclassindex - Index in constant poolClassFormatException - if index is invalidConstantpublic <T extends Constant> T getConstant(int index, byte tag) throws ClassFormatException
T - A Constant subclassindex - Index in constant pooltag - Tag of expected constant, i.e., its typeClassFormatException - if constant type does not match tagConstantpublic <T extends Constant> T getConstant(int index, java.lang.Class<T> castTo) throws ClassFormatException
T - A Constant subclassindex - Index in constant poolcastTo - The Constant subclass to cast to.ClassFormatException - if index is invalidConstantpublic ConstantInteger getConstantInteger(int index)
index - Index in constant poolClassFormatException - if constant type does not match tagConstantIntegerpublic ConstantUtf8 getConstantUtf8(int index) throws ClassFormatException
index - Index in constant poolClassFormatException - if constant type does not match tagConstantUtf8Copyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.