KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > tax > dom > DOMImplementationImpl


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.tax.dom;
21
22 import org.w3c.dom.*;
23
24 /**
25  *
26  * @author Petr Kuzel
27  */

28 class DOMImplementationImpl implements DOMImplementation {
29
30     /** Creates a new instance of DOMImplementationImpl */
31     public DOMImplementationImpl() {
32     }
33
34     /** Creates a DOM Document object of the specified type with its document
35      * element.
36      * @param namespaceURI The namespace URI of the document element to
37      * create.
38      * @param qualifiedName The qualified name of the document element to be
39      * created.
40      * @param doctype The type of document to be created or <code>null</code>.
41      * When <code>doctype</code> is not <code>null</code>, its
42      * <code>Node.ownerDocument</code> attribute is set to the document
43      * being created.
44      * @return A new <code>Document</code> object.
45      * @exception DOMException
46      * INVALID_CHARACTER_ERR: Raised if the specified qualified name
47      * contains an illegal character.
48      * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
49      * malformed, if the <code>qualifiedName</code> has a prefix and the
50      * <code>namespaceURI</code> is <code>null</code>, or if the
51      * <code>qualifiedName</code> has a prefix that is "xml" and the
52      * <code>namespaceURI</code> is different from "
53      * http://www.w3.org/XML/1998/namespace" , or if the DOM
54      * implementation does not support the <code>"XML"</code> feature but
55      * a non-null namespace URI was provided, since namespaces were
56      * defined by XML.
57      * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
58      * been used with a different document or was created from a different
59      * implementation.
60      * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
61      * not support the "XML" feature, if they choose not to support this
62      * method. Other features introduced in the future, by the DOM WG or
63      * in extensions defined by other groups, may also demand support for
64      * this method; please consult the definition of the feature to see if
65      * it requires this method.
66      * @since DOM Level 2
67      *
68      */

69     public Document createDocument(String JavaDoc namespaceURI, String JavaDoc qualifiedName, DocumentType doctype) throws DOMException {
70         throw new ROException();
71     }
72     
73     /** Creates an empty <code>DocumentType</code> node. Entity declarations
74      * and notations are not made available. Entity reference expansions and
75      * default attribute additions do not occur. It is expected that a
76      * future version of the DOM will provide a way for populating a
77      * <code>DocumentType</code>.
78      * @param qualifiedName The qualified name of the document type to be
79      * created.
80      * @param publicId The external subset public identifier.
81      * @param systemId The external subset system identifier.
82      * @return A new <code>DocumentType</code> node with
83      * <code>Node.ownerDocument</code> set to <code>null</code>.
84      * @exception DOMException
85      * INVALID_CHARACTER_ERR: Raised if the specified qualified name
86      * contains an illegal character.
87      * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
88      * malformed.
89      * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
90      * not support the <code>"XML"</code> feature, if they choose not to
91      * support this method. Other features introduced in the future, by
92      * the DOM WG or in extensions defined by other groups, may also
93      * demand support for this method; please consult the definition of
94      * the feature to see if it requires this method.
95      * @since DOM Level 2
96      *
97      */

98     public DocumentType createDocumentType(String JavaDoc qualifiedName, String JavaDoc publicId, String JavaDoc systemId) throws DOMException {
99         throw new ROException();
100     }
101     
102     /** Test if the DOM implementation implements a specific feature.
103      * @param feature The name of the feature to test (case-insensitive). The
104      * values used by DOM features are defined throughout the DOM Level 2
105      * specifications and listed in the section. The name must be an XML
106      * name. To avoid possible conflicts, as a convention, names referring
107      * to features defined outside the DOM specification should be made
108      * unique.
109      * @param version This is the version number of the feature to test. In
110      * Level 2, the string can be either "2.0" or "1.0". If the version is
111      * not specified, supporting any version of the feature causes the
112      * method to return <code>true</code>.
113      * @return <code>true</code> if the feature is implemented in the
114      * specified version, <code>false</code> otherwise.
115      *
116      */

117     public boolean hasFeature(String JavaDoc feature, String JavaDoc version) {
118         return "1.0".equals(version);
119     }
120
121     public Object JavaDoc getFeature (String JavaDoc a, String JavaDoc b) {
122         throw new UOException ();
123     }
124     
125 }
126
Popular Tags