public class ClassConstant extends Constant
Constant
represents a class constant in the constant pool.Modifier and Type | Field and Description |
---|---|
Clazz |
javaLangClassClass
An extra field pointing to the java.lang.Class Clazz object.
|
Clazz |
referencedClass
An extra field pointing to the referenced Clazz object.
|
int |
u2nameIndex |
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 |
---|
ClassConstant()
Creates an uninitialized ClassConstant.
|
ClassConstant(int u2nameIndex,
Clazz referencedClass)
Creates a new ClassConstant with the given name index.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Clazz clazz,
ConstantVisitor constantVisitor)
Accepts the given visitor.
|
boolean |
equals(java.lang.Object object) |
java.lang.String |
getName(Clazz clazz)
Returns the name.
|
int |
getTag()
Returns the constant pool info tag that specifies the entry type.
|
int |
hashCode() |
boolean |
isCategory2()
Returns whether the constant is of category 2.
|
void |
referencedClassAccept(ClassVisitor classVisitor)
Lets the referenced class accept the given visitor.
|
java.lang.String |
toString() |
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
public int u2nameIndex
public Clazz referencedClass
ClassReferenceInitializer
.public Clazz javaLangClassClass
ClassReferenceInitializer
..public ClassConstant()
public ClassConstant(int u2nameIndex, Clazz referencedClass)
u2nameIndex
- the index of the name in the constant pool.referencedClass
- the referenced class.public java.lang.String getName(Clazz clazz)
public int getTag()
Constant
public boolean isCategory2()
Constant
isCategory2
in class Constant
public void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constant
public void referencedClassAccept(ClassVisitor classVisitor)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object