1 7 8 package jas; 9 10 import java.io.*; 11 import java.util.*; 12 13 public class InnerClassSpecAttr { 14 15 String inner_class_name; 16 String outer_class_name; 17 String inner_name; 18 short access; 19 20 void resolve(ClassEnv e){ 21 e.addCPItem(new ClassCP(inner_class_name)); 22 if (!outer_class_name.equals("null")){ 23 e.addCPItem(new ClassCP(outer_class_name)); 24 } 25 if (!inner_name.equals("null")){ 26 e.addCPItem(new AsciiCP(inner_name)); 27 } 28 } 29 30 34 public InnerClassSpecAttr(String a, String b, String c, short d) { inner_class_name = a; 36 outer_class_name = b; 37 inner_name = c; 38 access = d; 39 } 40 41 int size(){ 42 return 8; 43 } 44 45 46 void write(ClassEnv e, DataOutputStream out) 47 throws IOException, jasError 48 { 49 50 out.writeShort(e.getCPIndex(new ClassCP(inner_class_name))); 51 if (outer_class_name.equals("null")){ 52 out.writeShort(0); 53 } 54 else { 55 out.writeShort(e.getCPIndex(new ClassCP(outer_class_name))); 56 } 57 if (inner_name.equals("null")){ 58 out.writeShort(0); 59 } 60 else { 61 out.writeShort(e.getCPIndex(new AsciiCP(inner_name))); 62 } 63 out.writeShort(access); 64 74 } 75 } 76 | Popular Tags |