1f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project/* 24c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Copyright (c) 2004 World Wide Web Consortium, 34c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * 44c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * (Massachusetts Institute of Technology, European Research Consortium for 54c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Informatics and Mathematics, Keio University). All Rights Reserved. This 64c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * work is distributed under the W3C(r) Software License [1] in the hope that 74c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 84c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 94c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * 104c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 11f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 12f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 13f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Projectpackage org.w3c.dom; 14f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 15f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project/** 16f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * The <code>DOMImplementation</code> interface provides a number of methods 17f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * for performing operations that are independent of any particular instance 18f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * of the document object model. 194c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>. 20f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 21f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Projectpublic interface DOMImplementation { 22f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project /** 234c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Test if the DOM implementation implements a specific feature and 244c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * version, as specified in . 254c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @param feature The name of the feature to test. 264c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @param version This is the version number of the feature to test. 27f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @return <code>true</code> if the feature is implemented in the 28f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * specified version, <code>false</code> otherwise. 29f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 30f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project public boolean hasFeature(String feature, 31f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project String version); 32f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 33f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project /** 34f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Creates an empty <code>DocumentType</code> node. Entity declarations 35f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * and notations are not made available. Entity reference expansions and 364c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * default attribute additions do not occur.. 37f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @param qualifiedName The qualified name of the document type to be 384c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * created. 39f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @param publicId The external subset public identifier. 40f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @param systemId The external subset system identifier. 41f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @return A new <code>DocumentType</code> node with 42f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <code>Node.ownerDocument</code> set to <code>null</code>. 43f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @exception DOMException 444c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not 454c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * an XML name according to [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. 46f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 47f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * malformed. 484c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not 494c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * support the feature "XML" and the language exposed through the 504c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 51f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @since DOM Level 2 52f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 53f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project public DocumentType createDocumentType(String qualifiedName, 54f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project String publicId, 55f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project String systemId) 56f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project throws DOMException; 57f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 58f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project /** 594c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Creates a DOM Document object of the specified type with its document 604c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * element. 614c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <br>Note that based on the <code>DocumentType</code> given to create 624c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * the document, the implementation may instantiate specialized 634c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>Document</code> objects that support additional features than 644c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * the "Core", such as "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>] 654c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * . On the other hand, setting the <code>DocumentType</code> after the 664c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * document was created makes this very unlikely to happen. 674c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Alternatively, specialized <code>Document</code> creation methods, 684c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * such as <code>createHTMLDocument</code> [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>] 694c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * , can be used to obtain specific types of <code>Document</code> 704c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * objects. 714c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @param namespaceURI The namespace URI of the document element to 724c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * create or <code>null</code>. 73f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @param qualifiedName The qualified name of the document element to be 744c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * created or <code>null</code>. 75f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @param doctype The type of document to be created or <code>null</code>. 76f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * When <code>doctype</code> is not <code>null</code>, its 77f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <code>Node.ownerDocument</code> attribute is set to the document 78f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * being created. 794c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @return A new <code>Document</code> object with its document element. 804c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * If the <code>NamespaceURI</code>, <code>qualifiedName</code>, and 814c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>doctype</code> are <code>null</code>, the returned 824c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>Document</code> is empty with no document element. 83f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @exception DOMException 844c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not 854c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * an XML name according to [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. 86f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 87f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * malformed, if the <code>qualifiedName</code> has a prefix and the 88f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <code>namespaceURI</code> is <code>null</code>, or if the 894c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>qualifiedName</code> is <code>null</code> and the 904c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>namespaceURI</code> is different from <code>null</code>, or 914c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * if the <code>qualifiedName</code> has a prefix that is "xml" and 924c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'> 934c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 944c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * , or if the DOM implementation does not support the 954c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>"XML"</code> feature but a non-null namespace URI was 964c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * provided, since namespaces were defined by XML. 97f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already 98f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * been used with a different document or was created from a different 99f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * implementation. 1004c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not 1014c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * support the feature "XML" and the language exposed through the 1024c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 103f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * @since DOM Level 2 104f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 105f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project public Document createDocument(String namespaceURI, 106f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project String qualifiedName, 107f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project DocumentType doctype) 108f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project throws DOMException; 109f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 1104c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson /** 1114c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * This method returns a specialized object which implements the 1124c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * specialized APIs of the specified feature and version, as specified 1134c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * in . The specialized object may also be obtained by using 1144c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * binding-specific casting methods but is not necessarily expected to, 1154c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * as discussed in . This method also allow the implementation to 1164c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * provide specialized objects which do not support the 1174c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>DOMImplementation</code> interface. 1184c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @param feature The name of the feature requested. Note that any plus 1194c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * sign "+" prepended to the name of the feature will be ignored since 1204c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * it is not significant in the context of this method. 1214c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @param version This is the version number of the feature to test. 1224c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @return Returns an object which implements the specialized APIs of 1234c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * the specified feature and version, if any, or <code>null</code> if 1244c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * there is no object which implements interfaces associated with that 1254c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * feature. If the <code>DOMObject</code> returned by this method 1264c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * implements the <code>DOMImplementation</code> interface, it must 1274c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * delegate to the primary core <code>DOMImplementation</code> and not 1284c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * return results inconsistent with the primary core 1294c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>DOMImplementation</code> such as <code>hasFeature</code>, 1304c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * <code>getFeature</code>, etc. 1314c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson * @since DOM Level 3 1324c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson */ 1334c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson public Object getFeature(String feature, 1344c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson String version); 1354c7a0d97cf2b27790e6236965a1d798d710d7ec7Jesse Wilson 136f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project} 137