1 19 20 25 26 27 28 29 30 31 32 package soot.coffi; 33 34 import java.io.*; 35 36 40 public class field_info { 41 42 public int access_flags; 43 47 public int name_index; 48 52 public int descriptor_index; 53 54 public int attributes_count; 55 58 public attribute_info attributes[]; 59 60 64 public String toName(cp_info constant_pool[]) { 65 CONSTANT_Utf8_info ci; 66 ci = (CONSTANT_Utf8_info)(constant_pool[name_index]); 67 return ci.convert(); 68 } 69 70 74 public String prototype(cp_info constant_pool[]) { 75 ConstantValue_attribute cva; 76 CONSTANT_Utf8_info cm,dm; 77 int i,j; 78 String s; 79 80 cm = (CONSTANT_Utf8_info)(constant_pool[name_index]); 81 dm = (CONSTANT_Utf8_info)(constant_pool[descriptor_index]); 82 s = ClassFile.access_string(access_flags," "); 83 if (s.compareTo("")!=0) s = s + " "; 84 return s + ClassFile.parseDesc(dm.convert(),"") + " " + cm.convert(); 85 } 86 87 91 public ConstantValue_attribute findConstantValue_attribute() { 92 ConstantValue_attribute ca; 93 int i; 94 for (i=0;i<attributes_count;i++) { 95 if ((attributes[i]) instanceof ConstantValue_attribute) 96 return (ConstantValue_attribute)(attributes[i]); 97 } 98 return null; 99 } 100 101 } 102 | Popular Tags |