Package com.tonic.parser.constpool
Class InterfaceRefItem
- java.lang.Object
-
- com.tonic.parser.constpool.Item<InterfaceRef>
-
- com.tonic.parser.constpool.InterfaceRefItem
-
public class InterfaceRefItem extends Item<InterfaceRef>
Represents a CONSTANT_InterfaceMethodref entry in the constant pool.
-
-
Field Summary
-
Fields inherited from class com.tonic.parser.constpool.Item
ITEM_CLASS_REF, ITEM_DOUBLE, ITEM_DYNAMIC, ITEM_FIELD_REF, ITEM_FLOAT, ITEM_INTEGER, ITEM_INTERFACE_REF, ITEM_INVOKEDYNAMIC, ITEM_LONG, ITEM_METHOD_HANDLE, ITEM_METHOD_REF, ITEM_METHOD_TYPE, ITEM_MODULE, ITEM_NAME_TYPE_REF, ITEM_PACKAGE, ITEM_STRING_REF, ITEM_UTF_8
-
-
Constructor Summary
Constructors Constructor Description InterfaceRefItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstPoolgetConstPool()StringgetDescriptor()Retrieves the method descriptor from the constant pool.StringgetName()Retrieves the method name from the constant pool.StringgetOwner()Retrieves the owner interface internal name from the constant pool.intgetParameterCount()Returns the number of parameters for the interface method.intgetReturnTypeSlots()Returns the number of slots for the return type.bytegetType()Returns the type of the constant pool item.InterfaceRefgetValue()Returns the value held by the constant pool item.voidread(ClassFile classFile)Reads the constant pool item from the class file.voidsetClassIndex(int classIndex)Repoints this interface-method reference at a different owner class (constant-pool class index).voidsetConstPool(ConstPool constPool)Binds the pool used to resolve this reference, needed when the item was not read from a class file.voidsetValue(InterfaceRef value)Overwrites the class and name-and-type index pair.voidwrite(DataOutputStream dos)Writes the item to the output stream (excluding the tag byte, which is written by the caller).-
Methods inherited from class com.tonic.parser.constpool.Item
accept, getIndex, setClassFile
-
-
-
-
Method Detail
-
getConstPool
public ConstPool getConstPool()
- Returns:
- the const pool
-
setConstPool
public void setConstPool(ConstPool constPool)
Binds the pool used to resolve this reference, needed when the item was not read from a class file.- Parameters:
constPool- the owning constant pool
-
setValue
public void setValue(InterfaceRef value)
Overwrites the class and name-and-type index pair.- Parameters:
value- the new reference
-
read
public void read(ClassFile classFile)
Description copied from class:ItemReads the constant pool item from the class file.- Specified by:
readin classItem<InterfaceRef>- Parameters:
classFile- The ClassFile utility to read data.
-
write
public void write(DataOutputStream dos) throws IOException
Description copied from class:ItemWrites the item to the output stream (excluding the tag byte, which is written by the caller).- Specified by:
writein classItem<InterfaceRef>- Parameters:
dos- The output stream to write to.- Throws:
IOException- If an I/O error occurs.
-
getType
public byte getType()
Description copied from class:ItemReturns the type of the constant pool item.- Specified by:
getTypein classItem<InterfaceRef>- Returns:
- The constant pool tag.
-
getValue
public InterfaceRef getValue()
Description copied from class:ItemReturns the value held by the constant pool item.- Specified by:
getValuein classItem<InterfaceRef>- Returns:
- The value of type T.
-
setClassIndex
public void setClassIndex(int classIndex)
Repoints this interface-method reference at a different owner class (constant-pool class index).- Parameters:
classIndex- the new CONSTANT_Class index
-
getParameterCount
public int getParameterCount()
Returns the number of parameters for the interface method.- Returns:
- The number of parameters.
-
getReturnTypeSlots
public int getReturnTypeSlots()
Returns the number of slots for the return type.- Returns:
- The number of return type slots.
-
getOwner
public String getOwner()
Retrieves the owner interface internal name from the constant pool.- Returns:
- The owner interface internal name.
-
getName
public String getName()
Retrieves the method name from the constant pool.- Returns:
- The method name.
-
getDescriptor
public String getDescriptor()
Retrieves the method descriptor from the constant pool.- Returns:
- The method descriptor.
-
-