1 5 6 package org.w3c.tidy; 7 8 import org.w3c.dom.DOMException ; 9 10 30 31 public class DOMDocumentImpl extends DOMNodeImpl implements org.w3c.dom.Document { 32 33 private TagTable tt; 35 protected DOMDocumentImpl(Node adaptee) 36 { 37 super(adaptee); 38 tt = new TagTable(); 39 } 40 41 public void setTagTable(TagTable tt) 42 { 43 this.tt = tt; 44 } 45 46 47 48 51 public String getNodeName() 52 { 53 return "#document"; 54 } 55 56 59 public short getNodeType() 60 { 61 return org.w3c.dom.Node.DOCUMENT_NODE; 62 } 63 64 67 public org.w3c.dom.DocumentType getDoctype() 68 { 69 Node node = adaptee.content; 70 while (node != null) { 71 if (node.type == Node.DocTypeTag) break; 72 node = node.next; 73 } 74 if (node != null) 75 return (org.w3c.dom.DocumentType )node.getAdapter(); 76 else 77 return null; 78 } 79 80 83 public org.w3c.dom.DOMImplementation getImplementation() 84 { 85 return null; 87 } 88 89 92 public org.w3c.dom.Element getDocumentElement() 93 { 94 Node node = adaptee.content; 95 while (node != null) { 96 if (node.type == Node.StartTag || 97 node.type == Node.StartEndTag) break; 98 node = node.next; 99 } 100 if (node != null) 101 return (org.w3c.dom.Element )node.getAdapter(); 102 else 103 return null; 104 } 105 106 109 public org.w3c.dom.Element createElement(String tagName) 110 throws DOMException 111 { 112 Node node = new Node(Node.StartEndTag, null, 0, 0, tagName, tt); 113 if (node != null) { 114 if (node.tag == null) node.tag = tt.xmlTags; 116 return (org.w3c.dom.Element )node.getAdapter(); 117 } 118 else 119 return null; 120 } 121 122 125 public org.w3c.dom.DocumentFragment createDocumentFragment() 126 { 127 return null; 129 } 130 131 134 public org.w3c.dom.Text createTextNode(String data) 135 { 136 byte[] textarray = Lexer.getBytes(data); 137 Node node = new Node(Node.TextNode, textarray, 0, textarray.length); 138 if (node != null) 139 return (org.w3c.dom.Text )node.getAdapter(); 140 else 141 return null; 142 } 143 144 147 public org.w3c.dom.Comment createComment(String data) 148 { 149 byte[] textarray = Lexer.getBytes(data); 150 Node node = new Node(Node.CommentTag, textarray, 0, textarray.length); 151 if (node != null) 152 return (org.w3c.dom.Comment )node.getAdapter(); 153 else 154 return null; 155 } 156 157 160 public org.w3c.dom.CDATASection createCDATASection(String data) 161 throws DOMException 162 { 163 return null; 165 } 166 167 170 public org.w3c.dom.ProcessingInstruction createProcessingInstruction(String target, 171 String data) 172 throws DOMException 173 { 174 throw new DOMExceptionImpl(DOMException.NOT_SUPPORTED_ERR, 175 "HTML document"); 176 } 177 178 181 public org.w3c.dom.Attr createAttribute(String name) 182 throws DOMException 183 { 184 AttVal av = new AttVal(null, null, (int)'"', name, null); 185 if (av != null) { 186 av.dict = 187 AttributeTable.getDefaultAttributeTable().findAttribute(av); 188 return (org.w3c.dom.Attr )av.getAdapter(); 189 } else { 190 return null; 191 } 192 } 193 194 197 public org.w3c.dom.EntityReference createEntityReference(String name) 198 throws DOMException 199 { 200 return null; 202 } 203 204 207 public org.w3c.dom.NodeList getElementsByTagName(String tagname) 208 { 209 return new DOMNodeListByTagNameImpl(this.adaptee, tagname); 210 } 211 212 216 public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep) 217 throws org.w3c.dom.DOMException 218 { 219 return null; 220 } 221 222 226 public org.w3c.dom.Attr createAttributeNS(String namespaceURI, 227 String qualifiedName) 228 throws org.w3c.dom.DOMException 229 { 230 return null; 231 } 232 233 237 public org.w3c.dom.Element createElementNS(String namespaceURI, 238 String qualifiedName) 239 throws org.w3c.dom.DOMException 240 { 241 return null; 242 } 243 244 247 public org.w3c.dom.NodeList getElementsByTagNameNS(String namespaceURI, 248 String localName) 249 { 250 return null; 251 } 252 253 256 public org.w3c.dom.Element getElementById(String elementId) 257 { 258 return null; 259 } 260 261 public org.w3c.dom.Node adoptNode (org.w3c.dom.Node oNode) { 262 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl adoptNode() Not implemented"); 263 } 264 265 public short compareDocumentPosition (org.w3c.dom.Node oNode) { 266 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl compareDocumentPosition() Not implemented"); 267 } 268 269 public boolean isDefaultNamespace(String sStr1) { 270 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl isDefaultNamespace() Not implemented"); 271 } 272 273 public boolean isEqualNode(org.w3c.dom.Node oNode) { 274 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl isEqualNode() Not implemented"); 275 } 276 277 public boolean isSameNode(org.w3c.dom.Node oNode) { 278 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl isSameNode() Not implemented"); 279 } 280 281 public String lookupPrefix(String sStr1) { 282 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl lookupPreffix() Not implemented"); 283 } 284 285 public String lookupNamespaceURI(String sStr1) { 286 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl lookupNamespaceURI() Not implemented"); 287 } 288 289 public String getDocumentURI() { 290 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getDocumentURI() Not implemented"); 291 } 292 293 public void setDocumentURI(String sStr1) { 294 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl setDocumentURI() Not implemented"); 295 } 296 297 public boolean getStrictErrorChecking() { 298 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getStrictErrorChecking() Not implemented"); 299 } 300 301 public void setStrictErrorChecking(boolean bStrictCheck) { 302 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl setStrictErrorChecking() Not implemented"); 303 } 304 305 public boolean getXmlStandalone() { 306 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getXmlStandalone() Not implemented"); 307 } 308 309 public void setXmlStandalone(boolean bXmlStandalone) { 310 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl setXmlStandalone() Not implemented"); 311 } 312 313 public Object getFeature(String sStr1, String sStr2) { 314 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getFeature() Not implemented"); 315 } 316 317 public String getInputEncoding() { 318 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getInputEncoding() Not implemented"); 319 } 320 321 public String getXmlEncoding() { 322 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getXmlEncoding() Not implemented"); 323 } 324 325 public String getXmlVersion() { 326 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getXmlVersion() Not implemented"); 327 } 328 329 public void setXmlVersion(String sStr1) { 330 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl setXmlVersion() Not implemented"); 331 } 332 333 public Object getUserData(String sStr1) { 334 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getUserData() Not implemented"); 335 } 336 337 public Object setUserData(String sStr1, Object oObj2, org.w3c.dom.UserDataHandler oHndlr) { 338 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl setUserData() Not implemented"); 339 } 340 341 public org.w3c.dom.DOMConfiguration getDomConfig () { 342 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getDomConfig() Not implemented"); 343 } 344 345 public void normalizeDocument () { 346 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl normalizeDocument() Not implemented"); 347 } 348 349 public org.w3c.dom.Node renameNode (org.w3c.dom.Node oNode, String sStr1, String sStr2) { 350 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl renameNode() Not implemented"); 351 } 352 353 public String getBaseURI() { 354 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getBaseURI() Not implemented"); 355 } 356 357 public String getTextContent() { 358 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl getTextContent() Not implemented"); 359 } 360 361 public void setTextContent(String sStr1) { 362 throw new UnsupportedOperationException ("org.w3c.tidy.DOMDocumentImpl setTextContent() Not implemented"); 363 } 364 365 } 366 | Popular Tags |