Top Description Constructors Methods
org.apache.bcel.generic

public abstract Class FieldInstruction

extends FieldOrMethod
Class Inheritance
Known Direct Subclasses
org.apache.bcel.generic.GETFIELD, org.apache.bcel.generic.GETSTATIC, org.apache.bcel.generic.PUTSTATIC, org.apache.bcel.generic.PUTFIELD
Imports
org.apache.bcel.classfile.ConstantPool

Super class for the GET/PUTxxx family of instructions.

Constructor Summary

AccessConstructor and Description
pack-priv
FieldInstruction()

Empty constructor needed for Instruction.readInstruction.

protected
FieldInstruction(final short opcode, final int
to constant pool
index
)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

name of referenced field.
getFieldName
(final ConstantPoolGen cpg)

protected int

Returns:

size of field (1 or 2)
getFieldSize
(final ConstantPoolGen cpg)

public Type

Returns:

type of field
getFieldType
(final ConstantPoolGen cpg)

public Type

Returns:

return type of referenced field
getType
(final ConstantPoolGen
A ConstantPoolGen
cpg
)

Overrides org.apache.bcel.generic.CPInstruction.getType.

Implements org.apache.bcel.generic.LoadClass.getType, org.apache.bcel.generic.TypedInstruction.getType.

Returns the type associated with this instruction.
public String

Returns:

mnemonic for instruction with symbolic references resolved
toString
(final ConstantPool cp)

Overrides org.apache.bcel.generic.CPInstruction.toString.

Inherited from org.apache.bcel.generic.FieldOrMethod:
getClassNamegetClassTypegetLoadClassTypegetNamegetReferenceTypegetSignature

Constructor Detail

FieldInstructionback to summary
pack-priv FieldInstruction()

Empty constructor needed for Instruction.readInstruction. Not to be used otherwise.

FieldInstructionback to summary
protected FieldInstruction(final short opcode, final int index)
Parameters
index:int

to constant pool

Method Detail

getFieldNameback to summary
public String getFieldName(final ConstantPoolGen cpg)
Returns:String

name of referenced field.

getFieldSizeback to summary
protected int getFieldSize(final ConstantPoolGen cpg)
Returns:int

size of field (1 or 2)

getFieldTypeback to summary
public Type getFieldType(final ConstantPoolGen cpg)
Returns:Type

type of field

getTypeback to summary
public Type getType(final ConstantPoolGen cpg)

Overrides org.apache.bcel.generic.CPInstruction.getType.

Implements org.apache.bcel.generic.LoadClass.getType, org.apache.bcel.generic.TypedInstruction.getType.

Doc from org.apache.bcel.generic.LoadClass.getType.

Returns the type associated with this instruction. LoadClass instances are always typed, but this type does not always refer to the type of the class or interface that it possibly forces to load. For example, GETFIELD would return the type of the field and not the type of the class where the field is defined. If no class is forced to be loaded, null is returned. An example for this is an NEWARRAY instruction that creates an int[][].

Parameters
cpg:ConstantPoolGen

A ConstantPoolGen

Returns:Type

return type of referenced field

Annotations
@Override
toStringback to summary
public String toString(final ConstantPool cp)

Overrides org.apache.bcel.generic.CPInstruction.toString.

Returns:String

mnemonic for instruction with symbolic references resolved

Annotations
@Override