public class ConstantPool extends Object
Constant
Modifier and Type | Method and Description |
---|---|
Constant |
getConstant(int index)
Gets constant from constant pool.
|
Constant |
getConstant(int index,
byte tag)
Gets constant from constant pool and check whether it has the
expected type.
|
public Constant getConstant(int index)
index
- Index in constant poolConstant
public Constant getConstant(int index, byte tag) throws ClassFormatException
index
- Index in constant pooltag
- Tag of expected constant, i.e., its typeClassFormatException
- If the constant is not of the expected typeConstant
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.