Class Utf8Item


  • public class Utf8Item
    extends Item<String>
    A CONSTANT_Utf8 entry in the constant pool, stored in JVMS modified UTF-8.
    • Constructor Detail

      • Utf8Item

        public Utf8Item()
    • Method Detail

      • setValue

        public void setValue​(String value)
        Replaces the string this entry holds.
        Parameters:
        value - the new string value
      • 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<String>
        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<String>
        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<String>
        Returns:
        The constant pool tag.
      • getValue

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