Class StringRefItem


  • public class StringRefItem
    extends Item<Integer>
    A CONSTANT_String constant pool entry, holding the pool index of its UTF-8 value.
    • Constructor Detail

      • StringRefItem

        public StringRefItem()
    • Method Detail

      • setValue

        public void setValue​(Integer value)
        Repoints this entry at another string constant.
        Parameters:
        value - constant pool index of the UTF-8 entry holding the text
      • 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<Integer>
        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<Integer>
        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<Integer>
        Returns:
        The constant pool tag.
      • getValue

        public Integer getValue()
        Description copied from class: Item
        Returns the value held by the constant pool item.
        Specified by:
        getValue in class Item<Integer>
        Returns:
        The value of type T.