1 package serp.bytecode.lowlevel;
2
3 import java.io.*;
4
5 import serp.bytecode.visitor.*;
6
7
8
9
10
11
12 public class UTF8Entry extends Entry implements ConstantEntry {
13 private String _value = "";
14
15
16
17
18 public UTF8Entry() {
19 }
20
21
22
23
24
25
26 public UTF8Entry(String value) {
27 _value = value;
28 }
29
30 public int getType() {
31 return Entry.UTF8;
32 }
33
34
35
36
37 public String getValue() {
38 return _value;
39 }
40
41
42
43
44 public void setValue(String value) {
45 if (value == null)
46 throw new NullPointerException("value = null");
47 Object key = beforeModify();
48 _value = value;
49 afterModify(key);
50 }
51
52 public Object getConstant() {
53 return getValue();
54 }
55
56 public void setConstant(Object value) {
57 setValue((String) value);
58 }
59
60 public void acceptVisit(BCVisitor visit) {
61 visit.enterUTF8Entry(this);
62 visit.exitUTF8Entry(this);
63 }
64
65 void readData(DataInput in) throws IOException {
66 _value = in.readUTF();
67 }
68
69 void writeData(DataOutput out) throws IOException {
70 out.writeUTF(_value);
71 }
72 }