Package org.apache.bcel.generic
Class FieldInstruction
- java.lang.Object
-
- org.apache.bcel.generic.Instruction
-
- org.apache.bcel.generic.CPInstruction
-
- org.apache.bcel.generic.FieldOrMethod
-
- org.apache.bcel.generic.FieldInstruction
-
- All Implemented Interfaces:
java.lang.Cloneable,IndexedInstruction,LoadClass,TypedInstruction
public abstract class FieldInstruction extends FieldOrMethod
Super class for the GET/PUTxxx family of instructions.
-
-
Field Summary
-
Fields inherited from class org.apache.bcel.generic.CPInstruction
index
-
Fields inherited from class org.apache.bcel.generic.Instruction
EMPTY_ARRAY, length, opcode
-
-
Constructor Summary
Constructors Modifier Constructor Description (package private)FieldInstruction()Empty constructor needed for Instruction.readInstruction.protectedFieldInstruction(short opcode, int index)Constructs a FieldInstruction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFieldName(ConstantPoolGen cpg)Gets the name of referenced field.protected intgetFieldSize(ConstantPoolGen cpg)Gets the size of field.TypegetFieldType(ConstantPoolGen cpg)Gets the type of field.TypegetType(ConstantPoolGen cpg)Gets the type associated with this instruction.java.lang.StringtoString(ConstantPool cp)Gets the mnemonic for instruction with symbolic references resolved.-
Methods inherited from class org.apache.bcel.generic.FieldOrMethod
getClassName, getClassType, getLoadClassType, getName, getReferenceType, getSignature
-
Methods inherited from class org.apache.bcel.generic.CPInstruction
dump, getIndex, initFromFile, setIndex, toString
-
Methods inherited from class org.apache.bcel.generic.Instruction
accept, consumeStack, copy, dispose, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, setLength, setOpcode, toString
-
-
-
-
Method Detail
-
getFieldName
public java.lang.String getFieldName(ConstantPoolGen cpg)
Gets the name of referenced field.- Parameters:
cpg- the constant pool generator.- Returns:
- name of referenced field.
-
getFieldSize
protected int getFieldSize(ConstantPoolGen cpg)
Gets the size of field.- Parameters:
cpg- the constant pool generator.- Returns:
- size of field (1 or 2).
-
getFieldType
public Type getFieldType(ConstantPoolGen cpg)
Gets the type of field.- Parameters:
cpg- the constant pool generator.- Returns:
- type of field.
-
getType
public Type getType(ConstantPoolGen cpg)
Description copied from interface:TypedInstructionGets the type associated with this instruction.- Specified by:
getTypein interfaceLoadClass- Specified by:
getTypein interfaceTypedInstruction- Overrides:
getTypein classCPInstruction- Parameters:
cpg- the constant pool generator.- Returns:
- return type of referenced field.
- See Also:
LoadClass.getLoadClassType(ConstantPoolGen)
-
toString
public java.lang.String toString(ConstantPool cp)
Description copied from class:InstructionGets the mnemonic for instruction with symbolic references resolved.- Overrides:
toStringin classCPInstruction- Parameters:
cp- the constant pool.- Returns:
- mnemonic for instruction with symbolic references resolved.
-
-