Package org.apache.bcel.classfile
Class ConstantCP
java.lang.Object
org.apache.bcel.classfile.Constant
org.apache.bcel.classfile.ConstantCP
- Direct Known Subclasses:
ConstantDynamic
,ConstantFieldref
,ConstantInterfaceMethodref
,ConstantInvokeDynamic
,ConstantMethodref
Abstract super class for Fieldref, Methodref, InterfaceMethodref and InvokeDynamic constants.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected int
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter -
Constructor Summary
ModifierConstructorDescriptionprotected
ConstantCP
(byte tag, int classIndex, int nameAndTypeIndex) Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
dump
(DataOutputStream file) Dump constant field reference to file stream in binary format.getClass
(ConstantPool cp) final int
final int
final void
setClassIndex
(int classIndex) final void
setNameAndTypeIndex
(int nameAndTypeIndex) toString()
Methods inherited from class org.apache.bcel.classfile.Constant
accept, clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparator
-
Field Details
-
class_index
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter -
name_and_type_index
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
-
-
Constructor Details
-
ConstantCP
- Parameters:
classIndex
- Reference to the class containing the fieldnameAndTypeIndex
- and the field signature
-
ConstantCP
Initialize from another object.- Parameters:
c
- Source to copy.
-
-
Method Details
-
dump
Dump constant field reference to file stream in binary format.- Specified by:
dump
in classConstant
- Parameters:
file
- Output file stream- Throws:
IOException
- if an I/O error occurs.
-
getClass
- Returns:
- Class this field belongs to.
-
getClassIndex
- Returns:
- Reference (index) to class this constant refers to.
-
getNameAndTypeIndex
- Returns:
- Reference (index) to signature of the field.
-
setClassIndex
- Parameters:
classIndex
- points to Constant_class
-
setNameAndTypeIndex
- Parameters:
nameAndTypeIndex
- points to Constant_NameAndType
-
toString
-