Class ConstantDynamicItem


  • public class ConstantDynamicItem
    extends Item<ConstantDynamic>
    Represents a CONSTANT_Dynamic entry in the constant pool (tag 17/0x11).
    • Constructor Detail

      • ConstantDynamicItem

        public ConstantDynamicItem()
        Default constructor for reading from class file.
      • ConstantDynamicItem

        public ConstantDynamicItem​(ConstantDynamic value)
        Constructor for programmatic creation.
        Parameters:
        value - the ConstantDynamic value
    • Method Detail

      • setValue

        public void setValue​(ConstantDynamic value)
        Sets the ConstantDynamic value.
        Parameters:
        value - the value to set
      • setConstPool

        public void setConstPool​(ConstPool constPool)
        Sets the constant pool reference for name/descriptor resolution.
        Parameters:
        constPool - the constant pool
      • 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<ConstantDynamic>
        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<ConstantDynamic>
        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<ConstantDynamic>
        Returns:
        The constant pool tag.
      • getName

        public String getName()
        Retrieves the name from the constant pool.
        Returns:
        the name of the dynamic constant
      • getDescriptor

        public String getDescriptor()
        Retrieves the descriptor from the constant pool.
        Returns:
        the descriptor of the dynamic constant
      • getBootstrapMethodAttrIndex

        public int getBootstrapMethodAttrIndex()
        Gets the bootstrap method attribute index.
        Returns:
        the bootstrap method index