org.apache.bcel.generic

Class FieldInstruction

Implemented Interfaces:
Cloneable, Node, java.io.Serializable, TypedInstruction
Known Direct Subclasses:
GETFIELD, GETSTATIC, PUTFIELD, PUTSTATIC

public abstract class FieldInstruction
extends FieldOrMethod
implements TypedInstruction

Super class for the GET/PUTxxx family of instructions.
Version:
$Id: FieldInstruction.java,v 1.1.1.1 2001/10/29 20:00:12 jvanzyl Exp $
Author:
M. Dahm
See Also:
Serialized Form

Field Summary

Fields inherited from class org.apache.bcel.classfile.FieldOrMethod

attributes, attributes_count, constant_pool, name_index, signature_index

Fields inherited from class org.apache.bcel.classfile.AccessFlags

access_flags

Constructor Summary

FieldInstruction(short opcode, int index)

Method Summary

String
getFieldName(ConstantPoolGen cpg)
protected int
getFieldSize(ConstantPoolGen cpg)
Type
getFieldType(ConstantPoolGen cpg)
Type
getType(ConstantPoolGen cpg)
String
toString(ConstantPool cp)

Methods inherited from class org.apache.bcel.classfile.FieldOrMethod

copy_, dump, getAttributes, getConstantPool, getName, getNameIndex, getSignature, getSignatureIndex, setAttributes, setConstantPool, setNameIndex, setSignatureIndex

Methods inherited from class org.apache.bcel.classfile.AccessFlags

getAccessFlags, getModifiers, isAbstract, isAbstract, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags, setModifiers

Constructor Details

FieldInstruction

protected FieldInstruction(short opcode,
                           int index)
Parameters:
index - to constant pool

Method Details

getFieldName

public String getFieldName(ConstantPoolGen cpg)
Returns:
name of referenced field.

getFieldSize

protected int getFieldSize(ConstantPoolGen cpg)
Returns:
size of field (1 or 2)

getFieldType

public Type getFieldType(ConstantPoolGen cpg)
Returns:
type of field

getType

public Type getType(ConstantPoolGen cpg)
Specified by:
getType in interface TypedInstruction
Returns:
return type of referenced field

toString

public String toString(ConstantPool cp)
Returns:
mnemonic for instruction with symbolic references resolved