1 17 package org.apache.bcel.generic; 18 19 import org.apache.bcel.classfile.ConstantPool; 20 21 27 public abstract class FieldInstruction extends FieldOrMethod implements TypedInstruction { 28 29 33 FieldInstruction() { 34 } 35 36 37 40 protected FieldInstruction(short opcode, int index) { 41 super(opcode, index); 42 } 43 44 45 48 public String toString( ConstantPool cp ) { 49 return org.apache.bcel.Constants.OPCODE_NAMES[opcode] + " " 50 + cp.constantToString(index, org.apache.bcel.Constants.CONSTANT_Fieldref); 51 } 52 53 54 56 protected int getFieldSize( ConstantPoolGen cpg ) { 57 return getType(cpg).getSize(); 58 } 59 60 61 63 public Type getType( ConstantPoolGen cpg ) { 64 return getFieldType(cpg); 65 } 66 67 68 70 public Type getFieldType( ConstantPoolGen cpg ) { 71 return Type.getType(getSignature(cpg)); 72 } 73 74 75 77 public String getFieldName( ConstantPoolGen cpg ) { 78 return getName(cpg); 79 } 80 } 81 | Popular Tags |