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: * CommentImpl is an implementation of a Comment node
09: * @author Michael H. Kay
10: */
11:
12: final class CommentImpl extends NodeImpl {
13:
14: String comment;
15:
16: public CommentImpl(String content) {
17: this .comment = content;
18: }
19:
20: public final String getStringValue() {
21: return comment;
22: }
23:
24: public final int getNodeKind() {
25: return Type.COMMENT;
26: }
27:
28: /**
29: * Copy this node to a given outputter
30: */
31:
32: public void copy(Receiver out, int whichNamespaces,
33: boolean copyAnnotations, int locationId)
34: throws XPathException {
35: out.comment(comment, locationId, 0);
36: }
37:
38: }
39:
40: //
41: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
42: // you may not use this file except in compliance with the License. You may obtain a copy of the
43: // License at http://www.mozilla.org/MPL/
44: //
45: // Software distributed under the License is distributed on an "AS IS" basis,
46: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
47: // See the License for the specific language governing rights and limitations under the License.
48: //
49: // The Original Code is: all this file.
50: //
51: // The Initial Developer of the Original Code is Michael H. Kay.
52: //
53: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
54: //
55: // Contributor(s): none.
56: //
|