1 18 19 package alt.jiapi.reflect.instruction; 20 21 import alt.jiapi.file.ConstantPool; 22 import alt.jiapi.reflect.SignatureUtil; 23 24 31 public class FieldAccess extends ReferencingInstruction { 32 public static final int READ_INSTRUCTION = 1; 33 public static final int WRITE_INSTRUCTION = 2; 34 35 public FieldAccess(byte[] bytes, ConstantPool cp) { 36 super(bytes, cp); 37 } 38 39 42 public String getTypeName() { 43 String desc = getDescriptor(); 44 45 return SignatureUtil.toSimpleName(desc); 46 } 47 48 51 public String getFieldName() { 52 return getName(); 53 } 54 55 56 public String toString() { 57 StringBuffer sb = 58 new StringBuffer (Opcodes.opcodeStrings[0xff & getOpcode()]); 59 60 byte[] bytes = getBytes(); 61 for (int i = 1; i < bytes.length; i++) { 62 sb.append(" "); 63 sb.append(0xff & bytes[i]); 64 } 65 66 sb.append(" ; "); 67 sb.append(getClassName()); 68 sb.append("."); 69 sb.append(getFieldName()); 70 71 return sb.toString(); 72 } 73 } 74 75 | Popular Tags |