KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > kawa > xml > KText


1 // Copyright (c) 2004 Per M.A. Bothner.
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.kawa.xml;
5 import gnu.xml.*;
6 /* #ifdef use:org.w3c.dom.Node */
7 // import org.w3c.dom.*;
8
/* #endif */
9
10 public class KText extends KCharacterData
11   /* #ifdef use:org.w3c.dom.Node */
12   // implements org.w3c.dom.Text
13
/* #endif */
14 {
15   public KText (NodeTree seq, int ipos)
16   {
17     super(seq, ipos);
18   }
19
20   public static KText make (String JavaDoc text)
21   {
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 JavaDoc getNodeName()
32   {
33     return "#text";
34   }
35
36   /* #ifdef use:org.w3c.dom.Node */
37   // public Text splitText(int offset)
38
// throws DOMException
39
// {
40
// throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
41
// "splitText not supported");
42
// }
43
/* #endif */
44
45   public String JavaDoc getWholeText ()
46   {
47     throw new UnsupportedOperationException JavaDoc("getWholeText not implemented yet");
48   }
49
50   /* #ifdef use:org.w3c.dom.Node */
51   // public Text replaceWholeText (String content)
52
// throws DOMException
53
// {
54
// throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
55
// "splitText not supported");
56
// }
57
/* #endif */
58
59   public boolean hasAttributes ()
60   {
61     return false;
62   }
63
64   public boolean isElementContentWhitespace ()
65   {
66     return false;
67   }
68 }
69
Popular Tags