KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > tree > TextImpl


1 package net.sf.saxon.tree;
2 import net.sf.saxon.event.Receiver;
3 import net.sf.saxon.trans.XPathException;
4 import net.sf.saxon.type.Type;
5
6 /**
7   * A node in the XML parse tree representing character content<P>
8   * @author Michael H. Kay
9   */

10
11 final class TextImpl extends NodeImpl {
12
13     private String JavaDoc content;
14
15     public TextImpl(ParentNodeImpl parent, String JavaDoc content) {
16         this.parent = parent;
17         this.content = content;
18     }
19
20     /**
21     * Return the character value of the node.
22     * @return the string value of the node
23     */

24
25     public String JavaDoc getStringValue() {
26         return content;
27     }
28
29     /**
30     * Return the type of node.
31     * @return Type.TEXT
32     */

33
34     public final int getNodeKind() {
35         return Type.TEXT;
36     }
37
38     /**
39     * Copy this node to a given outputter
40     */

41
42     public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException {
43         out.characters(content, locationId, 0);
44     }
45
46     /**
47     * Copy the string-value of this node to a given outputter
48     */

49
50     //public void copyStringValue(Receiver out) throws XPathException {
51
// out.characters(content, 0);
52
//}
53

54 }
55
56 //
57
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
58
// you may not use this file except in compliance with the License. You may obtain a copy of the
59
// License at http://www.mozilla.org/MPL/
60
//
61
// Software distributed under the License is distributed on an "AS IS" basis,
62
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
63
// See the License for the specific language governing rights and limitations under the License.
64
//
65
// The Original Code is: all this file.
66
//
67
// The Initial Developer of the Original Code is Michael H. Kay.
68
//
69
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
70
//
71
// Contributor(s): none.
72
//
Popular Tags