1 28 29 package com.caucho.xml; 30 31 import org.w3c.dom.Comment ; 32 import org.w3c.dom.Node ; 33 34 import java.io.IOException ; 35 36 public class QComment extends QCharacterData implements Comment { 37 public QComment() 38 { 39 } 40 41 public QComment(String data) 42 { 43 super(data); 44 } 45 46 public String getNodeName() { return "#comment"; } 47 public short getNodeType() { return COMMENT_NODE; } 48 49 Node importNode(QDocument owner, boolean deep) 50 { 51 QComment comment = new QComment(_data); 52 comment._owner = owner; 53 return comment; 54 } 55 56 public void print(XmlPrinter os) throws IOException 57 { 58 os.comment(getData()); 59 } 60 61 private Object writeReplace() 62 { 63 return new SerializedXml(this); 64 } 65 66 public String toString() 67 { 68 return "Comment[" + getData() + "]"; 69 } 70 } 71 | Popular Tags |