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