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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected intDeprecated.(since 6.0) will be made private; do not access directly, use getter/setter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstantCP(byte tag, int classIndex, int nameAndTypeIndex) Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddump(DataOutputStream file) Dump constant field reference to file stream in binary format.getClass(ConstantPool cp) final intfinal intfinal voidsetClassIndex(int classIndex) final voidsetNameAndTypeIndex(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:
dumpin 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
-