1 7 8 package jas; 9 10 import java.io.*; 11 12 public class SourceAttr 13 { 14 static CP attr = new AsciiCP("SourceFile"); 15 16 CP name; 17 18 23 24 public SourceAttr(String name) 25 { this.name = new AsciiCP(name); } 26 27 32 public SourceAttr(CP name) 33 { this.name = name; } 34 35 void resolve(ClassEnv e) 36 { e.addCPItem(attr); e.addCPItem(name); } 37 38 void write(ClassEnv e, DataOutputStream out) 39 throws IOException, jasError 40 { 41 out.writeShort(e.getCPIndex(attr)); 42 out.writeInt(2); 43 out.writeShort(e.getCPIndex(name)); 44 } 45 } 46 47 | Popular Tags |