KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > tree > CommentImpl


1 package com.icl.saxon.tree;
2 import com.icl.saxon.output.Outputter;
3 import com.icl.saxon.om.NodeInfo;
4 import javax.xml.transform.TransformerException JavaDoc;
5
6 import org.w3c.dom.Comment JavaDoc;
7 import org.w3c.dom.DOMException JavaDoc;
8
9 /**
10   * CommentImpl is an implementation of a Comment node
11   * @author Michael H. Kay (mhkay@iclway.co.uk)
12   */

13   
14
15 final class CommentImpl extends NodeImpl implements Comment JavaDoc {
16     
17     String JavaDoc comment;
18
19     public CommentImpl(String JavaDoc content) {
20         this.comment = content;
21     }
22
23     /**
24     * Get the name of this node, following the DOM rules
25     * @return "#comment"
26     */

27
28     public final String JavaDoc getNodeName() {
29         return "#comment";
30     }
31
32     public final String JavaDoc getStringValue() {
33         return comment;
34     }
35
36     public final short getNodeType() {
37         return NodeInfo.COMMENT;
38     }
39
40     /**
41     * Copy this node to a given outputter
42     */

43
44     public void copy(Outputter out) throws TransformerException JavaDoc {
45         out.writeComment(comment);
46     }
47     
48 }
49
50
51 //
52
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
53
// you may not use this file except in compliance with the License. You may obtain a copy of the
54
// License at http://www.mozilla.org/MPL/
55
//
56
// Software distributed under the License is distributed on an "AS IS" basis,
57
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
58
// See the License for the specific language governing rights and limitations under the License.
59
//
60
// The Original Code is: all this file.
61
//
62
// The Initial Developer of the Original Code is
63
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
64
//
65
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
66
//
67
// Contributor(s): none.
68
//
69
Popular Tags