Class InvokeDynamicItem


  • public class InvokeDynamicItem
    extends Item<InvokeDynamic>
    Represents a CONSTANT_InvokeDynamic entry in the constant pool.
    • 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: Item
        Reads the constant pool item from the class file.
        Specified by:
        read in class Item<InvokeDynamic>
        Parameters:
        classFile - The ClassFile utility to read data.
      • write

        public void write​(DataOutputStream dos)
                   throws IOException
        Description copied from class: Item
        Writes the item to the output stream (excluding the tag byte, which is written by the caller).
        Specified by:
        write in class Item<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: Item
        Returns the type of the constant pool item.
        Specified by:
        getType in class Item<InvokeDynamic>
        Returns:
        The constant pool tag.
      • getValue

        public InvokeDynamic getValue()
        Description copied from class: Item
        Returns the value held by the constant pool item.
        Specified by:
        getValue in class Item<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.