1 /* 2 * Copyright (c) 2000 World Wide Web Consortium, 3 * (Massachusetts Institute of Technology, Institut National de 4 * Recherche en Informatique et en Automatique, Keio University). All 5 * Rights Reserved. This program is distributed under the W3C's Software 6 * Intellectual Property License. This program is distributed in the 7 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even 8 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 * PURPOSE. 10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details. 11 */ 12 13 package org.w3c.dom; 14 15 // BEGIN android-note 16 // Cleaned up @param tags that seemed to be missing spaces between 17 // the parameter name and the start of the description. 18 // END android-note 19 20 /** 21 * The <code>DOMImplementation</code> interface provides a number of methods 22 * for performing operations that are independent of any particular instance 23 * of the document object model. 24 * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. 25 */ 26 public interface DOMImplementation { 27 /** 28 * Test if the DOM implementation implements a specific feature. 29 * @param feature The name of the feature to test (case-insensitive). The 30 * values used by DOM features are defined throughout the DOM Level 2 31 * specifications and listed in the section. The name must be an XML 32 * name. To avoid possible conflicts, as a convention, names referring 33 * to features defined outside the DOM specification should be made 34 * unique by reversing the name of the Internet domain name of the 35 * person (or the organization that the person belongs to) who defines 36 * the feature, component by component, and using this as a prefix. 37 * For instance, the W3C SVG Working Group defines the feature 38 * "org.w3c.dom.svg". 39 * @param version This is the version number of the feature to test. In 40 * Level 2, the string can be either "2.0" or "1.0". If the version is 41 * not specified, supporting any version of the feature causes the 42 * method to return <code>true</code>. 43 * @return <code>true</code> if the feature is implemented in the 44 * specified version, <code>false</code> otherwise. 45 */ hasFeature(String feature, String version)46 public boolean hasFeature(String feature, 47 String version); 48 49 /** 50 * Creates an empty <code>DocumentType</code> node. Entity declarations 51 * and notations are not made available. Entity reference expansions and 52 * default attribute additions do not occur. It is expected that a 53 * future version of the DOM will provide a way for populating a 54 * <code>DocumentType</code>. 55 * <br>HTML-only DOM implementations do not need to implement this method. 56 * @param qualifiedName The qualified name of the document type to be 57 * created. 58 * @param publicId The external subset public identifier. 59 * @param systemId The external subset system identifier. 60 * @return A new <code>DocumentType</code> node with 61 * <code>Node.ownerDocument</code> set to <code>null</code>. 62 * @exception DOMException 63 * INVALID_CHARACTER_ERR: Raised if the specified qualified name 64 * contains an illegal character. 65 * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 66 * malformed. 67 * @since DOM Level 2 68 */ createDocumentType(String qualifiedName, String publicId, String systemId)69 public DocumentType createDocumentType(String qualifiedName, 70 String publicId, 71 String systemId) 72 throws DOMException; 73 74 /** 75 * Creates an XML <code>Document</code> object of the specified type with 76 * its document element. HTML-only DOM implementations do not need to 77 * implement this method. 78 * @param namespaceURI The namespace URI of the document element to create. 79 * @param qualifiedName The qualified name of the document element to be 80 * created. 81 * @param doctype The type of document to be created or <code>null</code>. 82 * When <code>doctype</code> is not <code>null</code>, its 83 * <code>Node.ownerDocument</code> attribute is set to the document 84 * being created. 85 * @return A new <code>Document</code> object. 86 * @exception DOMException 87 * INVALID_CHARACTER_ERR: Raised if the specified qualified name 88 * contains an illegal character. 89 * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 90 * malformed, if the <code>qualifiedName</code> has a prefix and the 91 * <code>namespaceURI</code> is <code>null</code>, or if the 92 * <code>qualifiedName</code> has a prefix that is "xml" and the 93 * <code>namespaceURI</code> is different from " 94 * http://www.w3.org/XML/1998/namespace" . 95 * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already 96 * been used with a different document or was created from a different 97 * implementation. 98 * @since DOM Level 2 99 */ createDocument(String namespaceURI, String qualifiedName, DocumentType doctype)100 public Document createDocument(String namespaceURI, 101 String qualifiedName, 102 DocumentType doctype) 103 throws DOMException; 104 105 } 106