Package com.tonic.parser.constpool
Class InvokeDynamicItem
- java.lang.Object
-
- com.tonic.parser.constpool.Item<InvokeDynamic>
-
- com.tonic.parser.constpool.InvokeDynamicItem
-
public class InvokeDynamicItem extends Item<InvokeDynamic>
Represents a CONSTANT_InvokeDynamic entry in the constant pool.
-
-
Field Summary
-
Fields inherited from class com.tonic.parser.constpool.Item
ITEM_CLASS_REF, ITEM_DOUBLE, ITEM_DYNAMIC, ITEM_FIELD_REF, ITEM_FLOAT, ITEM_INTEGER, ITEM_INTERFACE_REF, ITEM_INVOKEDYNAMIC, ITEM_LONG, ITEM_METHOD_HANDLE, ITEM_METHOD_REF, ITEM_METHOD_TYPE, ITEM_MODULE, ITEM_NAME_TYPE_REF, ITEM_PACKAGE, ITEM_STRING_REF, ITEM_UTF_8
-
-
Constructor Summary
Constructors Constructor Description InvokeDynamicItem()Default constructor for parsing.InvokeDynamicItem(ConstPool constPool, int bootstrapMethodAttrIndex, int nameAndTypeIndex)Constructor for programmatic creation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescriptor()Retrieves the method descriptor from the constant pool.StringgetName()Retrieves the method name from the constant pool.intgetParameterCount()Returns the number of parameters for the dynamic call site.intgetReturnTypeSlots()Returns the number of slots for the return type.bytegetType()Returns the type of the constant pool item.InvokeDynamicgetValue()Returns the value held by the constant pool item.voidread(ClassFile classFile)Reads the constant pool item from the class file.voidwrite(DataOutputStream dos)Writes the item to the output stream (excluding the tag byte, which is written by the caller).-
Methods inherited from class com.tonic.parser.constpool.Item
accept, getIndex, setClassFile
-
-
-
-
Constructor Detail
-
InvokeDynamicItem
public InvokeDynamicItem()
Default constructor for parsing.
-
InvokeDynamicItem
public InvokeDynamicItem(ConstPool constPool, int bootstrapMethodAttrIndex, int nameAndTypeIndex)
Constructor for programmatic creation.- Parameters:
constPool- The constant pool this item belongs to.bootstrapMethodAttrIndex- The bootstrap method attribute index.nameAndTypeIndex- The name and type index.
-
-
Method Detail
-
read
public void read(ClassFile classFile)
Description copied from class:ItemReads the constant pool item from the class file.- Specified by:
readin classItem<InvokeDynamic>- Parameters:
classFile- The ClassFile utility to read data.
-
write
public void write(DataOutputStream dos) throws IOException
Description copied from class:ItemWrites the item to the output stream (excluding the tag byte, which is written by the caller).- Specified by:
writein classItem<InvokeDynamic>- Parameters:
dos- The output stream to write to.- Throws:
IOException- If an I/O error occurs.
-
getType
public byte getType()
Description copied from class:ItemReturns the type of the constant pool item.- Specified by:
getTypein classItem<InvokeDynamic>- Returns:
- The constant pool tag.
-
getValue
public InvokeDynamic getValue()
Description copied from class:ItemReturns the value held by the constant pool item.- Specified by:
getValuein classItem<InvokeDynamic>- Returns:
- The value of type T.
-
getParameterCount
public int getParameterCount()
Returns the number of parameters for the dynamic call site.- Returns:
- The number of parameters.
-
getReturnTypeSlots
public int getReturnTypeSlots()
Returns the number of slots for the return type.- Returns:
- The number of return type slots.
-
getName
public String getName()
Retrieves the method name from the constant pool.- Returns:
- The method name.
-
getDescriptor
public String getDescriptor()
Retrieves the method descriptor from the constant pool.- Returns:
- The method descriptor.
-
-