1 19 20 package org.netbeans.tax.dom; 21 22 import org.w3c.dom.*; 23 import org.netbeans.tax.*; 24 25 29 class CommentImpl extends NodeImpl implements Comment { 30 31 private final TreeComment peer; 32 33 34 public CommentImpl(TreeComment peer) { 35 this.peer = peer; 36 } 37 38 46 public void appendData(String arg) throws DOMException { 47 throw new ROException(); 48 } 49 50 65 public void deleteData(int offset, int count) throws DOMException { 66 throw new ROException(); 67 } 68 69 84 public String getData() throws DOMException { 85 return peer.getData(); 86 } 87 88 93 public int getLength() { 94 return peer.getLength(); 95 } 96 97 100 public String getNodeName() { 101 return "#comment"; 102 } 103 104 107 public short getNodeType() { 108 return Node.COMMENT_NODE; 109 } 110 111 121 public String getNodeValue() throws DOMException { 122 return getData(); 123 } 124 125 133 public Node getParentNode() { 134 135 TreeParentNode parent = peer.getParentNode(); 136 if( parent == null ) 137 { 138 return null; 139 } 140 141 Node result = null; 142 try 143 { 144 result = Wrapper.wrap(parent); 145 } 146 catch( RuntimeException ex ) {} 147 148 return result; 149 } 150 151 161 public void insertData(int offset, String arg) throws DOMException { 162 throw new ROException(); 163 } 164 165 184 public void replaceData(int offset, int count, String arg) throws DOMException { 185 throw new ROException(); 186 } 187 188 203 public void setData(String data) throws DOMException { 204 throw new ROException(); 205 } 206 207 222 public String substringData(int offset, int count) throws DOMException { 223 try { 224 return peer.substringData(offset, count); 225 } catch (InvalidArgumentException ex) { 226 throw new UOException(); 227 } 228 } 229 230 234 public Node getPreviousSibling() { 235 return Children.getPreviousSibling(peer); 236 } 237 238 242 public Node getNextSibling() { 243 return Children.getNextSibling(peer); 244 } 245 246 } 247 | Popular Tags |