01: package net.sf.saxon.tree;
02:
03: import net.sf.saxon.event.Receiver;
04: import net.sf.saxon.trans.XPathException;
05: import net.sf.saxon.type.Type;
06:
07: /**
08: * A node in the XML parse tree representing character content<P>
09: * @author Michael H. Kay
10: */
11:
12: final class TextImpl extends NodeImpl {
13:
14: private String content;
15:
16: public TextImpl(ParentNodeImpl parent, String content) {
17: this .parent = parent;
18: this .content = content;
19: }
20:
21: /**
22: * Return the character value of the node.
23: * @return the string value of the node
24: */
25:
26: public String getStringValue() {
27: return content;
28: }
29:
30: /**
31: * Return the type of node.
32: * @return Type.TEXT
33: */
34:
35: public final int getNodeKind() {
36: return Type.TEXT;
37: }
38:
39: /**
40: * Copy this node to a given outputter
41: */
42:
43: public void copy(Receiver out, int whichNamespaces,
44: boolean copyAnnotations, int locationId)
45: throws XPathException {
46: out.characters(content, locationId, 0);
47: }
48:
49: /**
50: * Copy the string-value of this node to a given outputter
51: */
52:
53: //public void copyStringValue(Receiver out) throws XPathException {
54: // out.characters(content, 0);
55: //}
56: }
57:
58: //
59: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
60: // you may not use this file except in compliance with the License. You may obtain a copy of the
61: // License at http://www.mozilla.org/MPL/
62: //
63: // Software distributed under the License is distributed on an "AS IS" basis,
64: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
65: // See the License for the specific language governing rights and limitations under the License.
66: //
67: // The Original Code is: all this file.
68: //
69: // The Initial Developer of the Original Code is Michael H. Kay.
70: //
71: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
72: //
73: // Contributor(s): none.
74: //
|