public class DynamicConstant extends Constant
Constant
represents a dynamic constant in the constant pool.Modifier and Type | Field and Description |
---|---|
Clazz[] |
referencedClasses
An extra field pointing to the Clazz objects referenced in the descriptor string.
|
int |
u2bootstrapMethodAttributeIndex |
int |
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 |
---|
DynamicConstant()
Creates an uninitialized InvokeDynamicConstant.
|
DynamicConstant(int u2bootstrapMethodAttributeIndex,
int u2nameAndTypeIndex,
Clazz[] referencedClasses)
Creates a new InvokeDynamicConstant with the given bootstrap method and name-and-type indices.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Clazz clazz,
ConstantVisitor constantVisitor)
Accepts the given visitor.
|
void |
bootstrapMethodHandleAccept(Clazz clazz,
ConstantVisitor constantVisitor)
Lets the bootstrap method handle constant accept the given visitor.
|
boolean |
equals(java.lang.Object object) |
int |
getBootstrapMethodAttributeIndex()
Returns the index of the bootstrap method in the bootstrap methods attribute of the class.
|
java.lang.String |
getName(Clazz clazz)
Returns the method name.
|
int |
getNameAndTypeIndex()
Returns the name-and-type index.
|
int |
getTag()
Returns the constant pool info tag that specifies the entry type.
|
java.lang.String |
getType(Clazz clazz)
Returns the method type.
|
int |
hashCode() |
boolean |
isCategory2()
Returns whether the constant is of category 2.
|
void |
referencedClassesAccept(ClassVisitor classVisitor)
Lets the Clazz objects referenced in the descriptor string accept the given visitor.
|
java.lang.String |
toString() |
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
public int u2bootstrapMethodAttributeIndex
public int u2nameAndTypeIndex
public Clazz[] referencedClasses
ClassReferenceInitializer
. References
to primitive types are ignored.public DynamicConstant()
public DynamicConstant(int u2bootstrapMethodAttributeIndex, int u2nameAndTypeIndex, Clazz[] referencedClasses)
u2bootstrapMethodAttributeIndex
- the index of the bootstrap method entry in the bootstrap
methods attribute.u2nameAndTypeIndex
- the index of the name and type entry in the constant pool.referencedClasses
- the classes referenced by the type.public int getBootstrapMethodAttributeIndex()
public int getNameAndTypeIndex()
public java.lang.String getName(Clazz clazz)
public java.lang.String getType(Clazz clazz)
public void referencedClassesAccept(ClassVisitor classVisitor)
public void bootstrapMethodHandleAccept(Clazz clazz, ConstantVisitor constantVisitor)
public int getTag()
Constant
public boolean isCategory2()
Constant
isCategory2
in class Constant
public void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constant
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