KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > text > syntax > 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.modules.xml.text.syntax.dom;
21
22 import org.w3c.dom.*;
23 import org.netbeans.modules.xml.spi.dom.*;
24
25 /**
26  *
27  * @author Petr Kuzel
28  */

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

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

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

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