Package serp.bytecode.lowlevel
Class NameAndTypeEntry
java.lang.Object
serp.bytecode.lowlevel.Entry
serp.bytecode.lowlevel.NameAndTypeEntry
- All Implemented Interfaces:
VisitAcceptor
Entry containing indexes referencing a name and a descriptor. Used
to describe fields and methods of other classes referenced by opcodes.
-
Field Summary
FieldsFields inherited from class serp.bytecode.lowlevel.Entry
CLASS, DOUBLE, FIELD, FLOAT, INT, INTERFACEMETHOD, INVOKEDYNAMIC, LONG, METHOD, METHODHANDLE, METHODTYPE, NAMEANDTYPE, STRING, UTF8 -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.NameAndTypeEntry(int nameIndex, int descriptorIndex) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisit(BCVisitor visit) Accept a visit from aBCVisitor, 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.Return the descriptor's referencedUTF8Entry.intReturn the constant pool index of theUTF8Entrycontaining the descriptor for this entity.Return the name's referencedUTF8Entry.intReturn the constant pool index of theUTF8Entrycontaining the name of this entity.intgetType()Return the type code for this entry type.(package private) voidThis method is called after reading the entry type from bytecode.voidsetDescriptorIndex(int descriptorIndex) Set the constant pool index of aUTF8Entrycontaining the descriptor for this entity.voidsetNameIndex(int nameIndex) Set the constant pool index of theUTF8Entrycontaining the name of this entity.(package private) voidwriteData(DataOutput out) This method is called after writing the entry type to bytecode.
-
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.
-
-
Method Details
-
getType
public int getType()Description copied from class:EntryReturn the type code for this entry type. -
getNameIndex
public int getNameIndex()Return the constant pool index of theUTF8Entrycontaining the name of this entity. -
setNameIndex
public void setNameIndex(int nameIndex) Set the constant pool index of theUTF8Entrycontaining the name of this entity. -
getNameEntry
Return the name's referencedUTF8Entry. 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 theUTF8Entrycontaining the descriptor for this entity. -
setDescriptorIndex
public void setDescriptorIndex(int descriptorIndex) Set the constant pool index of aUTF8Entrycontaining the descriptor for this entity. -
getDescriptorEntry
Return the descriptor's referencedUTF8Entry. This method can only be run for entries that have been added to a constant pool. -
acceptVisit
Description copied from interface:VisitAcceptorAccept a visit from aBCVisitor, 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
Description copied from class:EntryThis 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:
readDatain classEntry- Throws:
IOException
-
writeData
Description copied from class:EntryThis method is called after writing the entry type to bytecode. It should write all data for this entry to the given stream.- Specified by:
writeDatain classEntry- Throws:
IOException
-