Class NameAndTypeEntry

java.lang.Object
serp.bytecode.lowlevel.Entry
serp.bytecode.lowlevel.NameAndTypeEntry
All Implemented Interfaces:
VisitAcceptor

public class NameAndTypeEntry extends Entry
Entry containing indexes referencing a name and a descriptor. Used to describe fields and methods of other classes referenced by opcodes.
  • Field Details

    • _nameIndex

      private int _nameIndex
    • _descriptorIndex

      private int _descriptorIndex
  • Constructor Details

    • NameAndTypeEntry

      public NameAndTypeEntry()
      Default constructor.
    • NameAndTypeEntry

      public NameAndTypeEntry(int nameIndex, int descriptorIndex)
      Constructor.
      Parameters:
      nameIndex - the constant pool index of the UTF8Entry containing the name of this entity
      descriptorIndex - the constant pool index of the UTF8Entry containing the descriptor for this entity
  • Method Details

    • getType

      public int getType()
      Description copied from class: Entry
      Return the type code for this entry type.
      Specified by:
      getType in class Entry
    • getNameIndex

      public int getNameIndex()
      Return the constant pool index of the UTF8Entry containing the name of this entity.
    • setNameIndex

      public void setNameIndex(int nameIndex)
      Set the constant pool index of the UTF8Entry containing the name of this entity.
    • getNameEntry

      public UTF8Entry getNameEntry()
      Return the name's referenced UTF8Entry. This method can only be run for entries that have been added to a constant pool.
    • getDescriptorIndex

      public int getDescriptorIndex()
      Return the constant pool index of the UTF8Entry containing the descriptor for this entity.
    • setDescriptorIndex

      public void setDescriptorIndex(int descriptorIndex)
      Set the constant pool index of a UTF8Entry containing the descriptor for this entity.
    • getDescriptorEntry

      public UTF8Entry getDescriptorEntry()
      Return the descriptor's referenced UTF8Entry. This method can only be run for entries that have been added to a constant pool.
    • acceptVisit

      public void acceptVisit(BCVisitor visit)
      Description copied from interface: VisitAcceptor
      Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.
    • readData

      void readData(DataInput in) throws IOException
      Description copied from class: Entry
      This method is called after reading the entry type from bytecode. It should read all the data for this entry from the given stream.
      Specified by:
      readData in class Entry
      Throws:
      IOException
    • writeData

      void writeData(DataOutput out) throws IOException
      Description copied from class: Entry
      This method is called after writing the entry type to bytecode. It should write all data for this entry to the given stream.
      Specified by:
      writeData in class Entry
      Throws:
      IOException