38 |
package gnu.xml.dom; |
package gnu.xml.dom; |
39 |
|
|
40 |
import org.w3c.dom.CharacterData; |
import org.w3c.dom.CharacterData; |
41 |
|
import org.w3c.dom.DOMException; |
42 |
import org.w3c.dom.Node; |
import org.w3c.dom.Node; |
43 |
import org.w3c.dom.NodeList; |
import org.w3c.dom.NodeList; |
44 |
import org.w3c.dom.events.MutationEvent; |
import org.w3c.dom.events.MutationEvent; |
83 |
{ |
{ |
84 |
if (isReadonly()) |
if (isReadonly()) |
85 |
{ |
{ |
86 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
87 |
} |
} |
88 |
String value = text + arg; |
String value = text + arg; |
89 |
mutating(value); |
mutating(value); |
99 |
{ |
{ |
100 |
if (isReadonly()) |
if (isReadonly()) |
101 |
{ |
{ |
102 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
103 |
} |
} |
104 |
char[] raw = text.toCharArray(); |
char[] raw = text.toCharArray(); |
105 |
if (offset < 0 || count < 0 || offset > raw.length) |
if (offset < 0 || count < 0 || offset > raw.length) |
106 |
{ |
{ |
107 |
throw new DomEx(DomEx.INDEX_SIZE_ERR); |
throw new DomDOMException(DOMException.INDEX_SIZE_ERR); |
108 |
} |
} |
109 |
if ((offset + count) > raw.length) |
if ((offset + count) > raw.length) |
110 |
{ |
{ |
126 |
} |
} |
127 |
catch (IndexOutOfBoundsException x) |
catch (IndexOutOfBoundsException x) |
128 |
{ |
{ |
129 |
throw new DomEx(DomEx.INDEX_SIZE_ERR); |
throw new DomDOMException(DOMException.INDEX_SIZE_ERR); |
130 |
} |
} |
131 |
} |
} |
132 |
|
|
165 |
{ |
{ |
166 |
if (isReadonly()) |
if (isReadonly()) |
167 |
{ |
{ |
168 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
169 |
} |
} |
170 |
char[] raw = text.toCharArray(); |
char[] raw = text.toCharArray(); |
171 |
char[] tmp = arg.toCharArray (); |
char[] tmp = arg.toCharArray (); |
183 |
} |
} |
184 |
catch (IndexOutOfBoundsException x) |
catch (IndexOutOfBoundsException x) |
185 |
{ |
{ |
186 |
throw new DomEx(DomEx.INDEX_SIZE_ERR); |
throw new DomDOMException(DOMException.INDEX_SIZE_ERR); |
187 |
} |
} |
188 |
} |
} |
189 |
|
|
196 |
{ |
{ |
197 |
if (readonly) |
if (readonly) |
198 |
{ |
{ |
199 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
200 |
} |
} |
201 |
char[] raw = text.toCharArray(); |
char[] raw = text.toCharArray(); |
202 |
|
|
203 |
// deleteData |
// deleteData |
204 |
if (offset < 0 || count < 0 || offset > raw.length) |
if (offset < 0 || count < 0 || offset > raw.length) |
205 |
{ |
{ |
206 |
throw new DomEx(DomEx.INDEX_SIZE_ERR); |
throw new DomDOMException(DOMException.INDEX_SIZE_ERR); |
207 |
} |
} |
208 |
if ((offset + count) > raw.length) |
if ((offset + count) > raw.length) |
209 |
{ |
{ |
229 |
} |
} |
230 |
catch (IndexOutOfBoundsException x) |
catch (IndexOutOfBoundsException x) |
231 |
{ |
{ |
232 |
throw new DomEx(DomEx.INDEX_SIZE_ERR); |
throw new DomDOMException(DOMException.INDEX_SIZE_ERR); |
233 |
} |
} |
234 |
} |
} |
235 |
|
|
242 |
{ |
{ |
243 |
if (isReadonly()) |
if (isReadonly()) |
244 |
{ |
{ |
245 |
throw new DomEx (DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
246 |
} |
} |
247 |
if (value == null) |
if (value == null) |
248 |
{ |
{ |
277 |
{ |
{ |
278 |
return text.substring(offset); |
return text.substring(offset); |
279 |
} |
} |
280 |
throw new DomEx(DomEx.INDEX_SIZE_ERR); |
throw new DomDOMException(DOMException.INDEX_SIZE_ERR); |
281 |
} |
} |
282 |
} |
} |
283 |
|
|