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
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 class_index, int name_and_type_index) 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 class_index) final void
setNameAndTypeIndex
(int name_and_type_index) 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
Initialize from another object. -
ConstantCP
protected ConstantCP(byte tag, int class_index, int name_and_type_index) - Parameters:
class_index
- Reference to the class containing the fieldname_and_type_index
- and the field signature
-
-
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
-
getClassIndex
public final int getClassIndex()- Returns:
- Reference (index) to class this constant refers to.
-
setClassIndex
public final void setClassIndex(int class_index) - Parameters:
class_index
- points to Constant_class
-
getNameAndTypeIndex
public final int getNameAndTypeIndex()- Returns:
- Reference (index) to signature of the field.
-
setNameAndTypeIndex
public final void setNameAndTypeIndex(int name_and_type_index) - Parameters:
name_and_type_index
- points to Constant_NameAndType
-
getClass
- Returns:
- Class this field belongs to.
-
toString
-