public class FieldrefConstant extends RefConstant
Constant
represents a field reference constant in the constant pool.Modifier and Type | Field and Description |
---|---|
Field |
referencedField
An extra field optionally pointing to the referenced Field object.
|
referencedClass, u2classIndex, u2nameAndTypeIndex
CLASS, DOUBLE, DYNAMIC, FIELDREF, FLOAT, INTEGER, INTERFACE_METHODREF, INVOKE_DYNAMIC, LONG, METHOD_HANDLE, METHOD_TYPE, METHODREF, MODULE, NAME_AND_TYPE, PACKAGE, PRIMITIVE_ARRAY, STRING, UTF8
processingFlags, processingInfo
Constructor and Description |
---|
FieldrefConstant()
Creates an uninitialized FieldrefConstant.
|
FieldrefConstant(int u2classIndex,
int u2nameAndTypeIndex,
Clazz referencedClass,
Field referencedField)
Creates a new FieldrefConstant with the given name and type indices.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Clazz clazz,
ConstantVisitor constantVisitor)
Accepts the given visitor.
|
int |
getTag()
Returns the constant pool info tag that specifies the entry type.
|
boolean |
isCategory2()
Returns whether the constant is of category 2.
|
void |
referencedFieldAccept(MemberVisitor memberVisitor)
Lets the referenced class field accept the given visitor.
|
void |
referencedMemberAccept(MemberVisitor memberVisitor)
Lets the referenced class member accept the given visitor.
|
java.lang.String |
toString() |
equals, getClassIndex, getClassName, getName, getNameAndTypeIndex, getType, hashCode, referencedClassAccept, setNameAndTypeIndex
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
public Field referencedField
ClassReferenceInitializer
.public FieldrefConstant()
public FieldrefConstant(int u2classIndex, int u2nameAndTypeIndex, Clazz referencedClass, Field referencedField)
u2classIndex
- the index of the class in the constant pool.u2nameAndTypeIndex
- the index of the name and type entry in the constant pool.referencedClass
- the referenced class.referencedField
- the referenced field.public void referencedFieldAccept(MemberVisitor memberVisitor)
public void referencedMemberAccept(MemberVisitor memberVisitor)
referencedMemberAccept
in class RefConstant
public int getTag()
Constant
public boolean isCategory2()
Constant
isCategory2
in class Constant
public void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constant
public java.lang.String toString()
toString
in class RefConstant