1 28 29 package com.caucho.bytecode; 30 31 import com.caucho.log.Log; 32 33 import java.io.IOException ; 34 import java.util.logging.Logger ; 35 36 39 public class Utf8Constant extends ConstantPoolEntry { 40 static private final Logger log = Log.open(Utf8Constant.class); 41 42 private String _value; 43 44 47 Utf8Constant(ConstantPool pool, int index, String value) 48 { 49 super(pool, index); 50 51 _value = value; 52 } 53 54 57 public String getValue() 58 { 59 return _value; 60 } 61 62 65 public void setValue(String value) 66 { 67 _value = value; 68 } 69 70 73 void write(ByteCodeWriter out) 74 throws IOException 75 { 76 out.write(ConstantPool.CP_UTF8); 77 out.writeUTF8(_value); 78 } 79 80 83 public int export(ConstantPool target) 84 { 85 return target.addUTF8(_value).getIndex(); 86 } 87 88 public String toString() 89 { 90 return "Utf8Constant[" + _value + "]"; 91 } 92 } 93 | Popular Tags |