1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sourceforge.jeuclid.dom;
20
21 import org.w3c.dom.Node;
22 import org.w3c.dom.Text;
23
24
25
26
27
28
29
30
31
32
33 public class PartialTextImpl extends AbstractPartialNodeImpl implements Text {
34
35 private String content;
36
37
38
39
40
41
42
43 public PartialTextImpl(final String text) {
44 this.content = text;
45 }
46
47
48 public String getWholeText() {
49 return this.content;
50 }
51
52
53 public boolean isElementContentWhitespace() {
54 throw new UnsupportedOperationException();
55 }
56
57
58 public Text replaceWholeText(final String newContent) {
59 this.content = newContent;
60 return this;
61 }
62
63
64 public Text splitText(final int offset) {
65 throw new UnsupportedOperationException();
66 }
67
68
69 public void appendData(final String arg) {
70 this.content = this.content + arg;
71 }
72
73
74 public void deleteData(final int offset, final int count) {
75 throw new UnsupportedOperationException();
76 }
77
78
79 public String getData() {
80 return this.content;
81 }
82
83
84 public int getLength() {
85 return this.content.length();
86 }
87
88
89 public void insertData(final int offset, final String arg) {
90 throw new UnsupportedOperationException();
91 }
92
93
94 public void replaceData(final int offset, final int count,
95 final String arg) {
96 throw new UnsupportedOperationException();
97 }
98
99
100 public void setData(final String data) {
101 this.content = data;
102 }
103
104
105 public String substringData(final int offset, final int count) {
106 throw new UnsupportedOperationException();
107 }
108
109
110 public String getNodeName() {
111 return "#text";
112 }
113
114
115 public short getNodeType() {
116 return Node.TEXT_NODE;
117 }
118
119
120 @Override
121 public String getNodeValue() {
122 return this.content;
123 }
124
125
126 @Override
127 public void setTextContent(final String newTextContent) {
128 this.content = newTextContent;
129 }
130
131
132 @Override
133 public String getTextContent() {
134 return this.content;
135 }
136
137 }