1 19 20 package org.netbeans.modules.xml.text.syntax.dom; 21 22 import org.w3c.dom.*; 23 import org.netbeans.modules.xml.text.syntax.*; 24 import org.netbeans.modules.xml.spi.dom.*; 25 import org.netbeans.editor.*; 26 27 32 public class CommentImpl extends SyntaxNode implements Comment { 33 34 public CommentImpl(XMLSyntaxSupport support, TokenItem from, int to) { 35 super( support, from, to ); 36 } 37 38 public String toString() { 39 return "Comment" + super.toString() + "<!--" + getData() + "-->"; 40 } 41 42 public String getNodeValue() throws org.w3c.dom.DOMException { 43 return getData(); 44 } 45 46 public String getNodeName() { 47 return "#comment"; } 49 50 public short getNodeType() { 51 return Node.COMMENT_NODE; 52 } 53 54 public Text splitText(int offset) { 55 throw new ROException(); 56 } 57 58 61 public String getData() { 62 String data = first.getImage(); return data.substring(("<!--".length() - 1) , (data.length() - "-->".length() -1 )); } 65 66 public void setData(String data) { 67 throw new ROException(); 68 } 69 70 public int getLength() { 71 return getData().length(); 72 } 73 74 public String substringData(int offset, int count) { 75 return getData().substring(offset, offset + count + 1); 76 } 77 78 public void appendData(String arg) { 79 throw new ROException(); 80 } 81 82 public void insertData(int offset, String arg) { 83 throw new ROException(); 84 } 85 86 87 public void deleteData(int offset, int count) { 88 throw new ROException(); 89 } 90 91 public void replaceData(int offset, int count, String arg) { 92 throw new ROException(); 93 } 94 95 96 } 97 98 | Popular Tags |