Class FieldRefItem


  • public class FieldRefItem
    extends Item<FieldRef>
    A CONSTANT_Fieldref constant pool entry.
    • Constructor Detail

      • FieldRefItem

        public FieldRefItem()
    • Method Detail

      • setValue

        public void setValue​(FieldRef value)
        Replaces the referenced class and name-and-type pair wholesale.
        Parameters:
        value - new field reference
      • 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<FieldRef>
        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<FieldRef>
        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<FieldRef>
        Returns:
        The constant pool tag.
      • getValue

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

        public void setClassIndex​(int classIndex)
        Repoints this field reference at a different owner class (constant-pool class index).
        Parameters:
        classIndex - the new CONSTANT_Class index
      • getClassName

        public String getClassName()
        Gets the class name from constant pool.
        Returns:
        class name or null if unavailable
      • getName

        public String getName()
        Gets the field name from constant pool.
        Returns:
        field name or null if unavailable
      • getDescriptor

        public String getDescriptor()
        Gets the field descriptor from constant pool.
        Returns:
        field descriptor or null if unavailable
      • getOwner

        public String getOwner()
        Gets owner class internal name from constant pool.
        Returns:
        owner class internal name or null if unavailable