01: // Copyright (c) 2004 Per M.A. Bothner.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.xml;
05:
06: import gnu.xml.*;
07:
08: /* #ifdef use:org.w3c.dom.Node */
09: // import org.w3c.dom.*;
10: /* #endif */
11:
12: public class KText extends KCharacterData
13: /* #ifdef use:org.w3c.dom.Node */
14: // implements org.w3c.dom.Text
15: /* #endif */
16: {
17: public KText(NodeTree seq, int ipos) {
18: super (seq, ipos);
19: }
20:
21: public static KText make(String text) {
22: NodeTree tree = new NodeTree();
23: tree.append(text);
24: return new KText(tree, 0);
25: }
26:
27: /* #ifdef use:org.w3c.dom.Node */
28: // public short getNodeType () { return Node.TEXT_NODE; }
29: /* #endif */
30:
31: public String getNodeName() {
32: return "#text";
33: }
34:
35: /* #ifdef use:org.w3c.dom.Node */
36: // public Text splitText(int offset)
37: // throws DOMException
38: // {
39: // throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
40: // "splitText not supported");
41: // }
42: /* #endif */
43:
44: public String getWholeText() {
45: throw new UnsupportedOperationException(
46: "getWholeText not implemented yet");
47: }
48:
49: /* #ifdef use:org.w3c.dom.Node */
50: // public Text replaceWholeText (String content)
51: // throws DOMException
52: // {
53: // throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
54: // "splitText not supported");
55: // }
56: /* #endif */
57:
58: public boolean hasAttributes() {
59: return false;
60: }
61:
62: public boolean isElementContentWhitespace() {
63: return false;
64: }
65: }
|