3 import java
.io
.UnsupportedEncodingException
;
5 public class StringNode
extends Node
{
6 private final String value
;
7 private final byte[] bytes
;
9 public StringNode(int code
, String value
) throws UnsupportedEncodingException
{
11 this.value
= (value
!= null)?value
:"";
12 this.bytes
= value
.getBytes("UTF-8");
15 public String
toString() {
16 return "<" + super.toString() + " value=\"" + value
+ "\" />";
19 public String
getValue() {
23 public byte[] getBytes() {
28 public int visit(Visitor visitor
) {
29 return visitor
.visitStringNode(this);