1 package org.enhydra.xml; 2 3 import org.w3c.dom.Comment ; 4 import org.w3c.dom.Node ; 5 6 17 public class CommentImpl extends CharacterDataImpl implements Comment { 18 19 24 public CommentImpl(CommentImpl node) { 25 super((NodeImpl)node); 26 } 27 28 29 34 public CommentImpl(String value) { 35 nodeValue = value; 36 type = Node.COMMENT_NODE; 37 } 38 39 40 46 public CommentImpl(Node node) { 47 super(node); 48 } 49 50 51 56 public short getNodeType() { 57 return Node.COMMENT_NODE; 58 } 59 60 65 public String getNodeName() { 66 return "#comment"; 67 } 68 69 70 77 protected void beginToString(StringBuffer sb, Indent indent) { 78 sb.append("\n" + indent + "<!-- " + this.nodeValue.trim()); 79 } 80 81 82 85 protected void endToString(StringBuffer sb, Indent indent) { 86 sb.append(" -->"); 87 } 88 89 90 } 91 | Popular Tags |