KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > dom > GenericDOMImplementation


1 /*
2
3    Copyright 2000,2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.dom;
19
20 import org.w3c.dom.DOMException JavaDoc;
21 import org.w3c.dom.DOMImplementation JavaDoc;
22 import org.w3c.dom.Document JavaDoc;
23 import org.w3c.dom.DocumentType JavaDoc;
24
25 /**
26  * This class implements the {@link org.w3c.dom.DOMImplementation}.
27  *
28  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
29  * @version $Id: GenericDOMImplementation.java,v 1.6 2005/02/22 09:12:58 cam Exp $
30  */

31 public class GenericDOMImplementation extends AbstractDOMImplementation {
32     /**
33      * The default instance of this class.
34      */

35     protected final static DOMImplementation JavaDoc DOM_IMPLEMENTATION =
36         new GenericDOMImplementation();
37
38     /**
39      * Creates a new GenericDOMImplementation object.
40      */

41     public GenericDOMImplementation() {
42     }
43
44     /**
45      * Returns the default instance of this class.
46      */

47     public static DOMImplementation JavaDoc getDOMImplementation() {
48         return DOM_IMPLEMENTATION;
49     }
50
51     // DOMImplementation //////////////////////////////////////////////////////
52

53     /**
54      * <b>DOM</b>: Implements {@link
55      * DOMImplementation#createDocumentType(String,String,String)}.
56      */

57     public DocumentType JavaDoc createDocumentType(String JavaDoc qualifiedName,
58                                            String JavaDoc publicId,
59                                            String JavaDoc systemId) {
60     throw new DOMException JavaDoc(DOMException.NOT_SUPPORTED_ERR,
61                                "Doctype not supported");
62     }
63
64     /**
65      * <b>DOM</b>: Implements {@link
66      * DOMImplementation#createDocument(String,String,DocumentType)}
67 .
68      */

69     public Document JavaDoc createDocument(String JavaDoc namespaceURI,
70                                    String JavaDoc qualifiedName,
71                                    DocumentType JavaDoc doctype) throws DOMException JavaDoc {
72         Document JavaDoc result = new GenericDocument(doctype, this);
73         result.appendChild(result.createElementNS(namespaceURI,
74                                                   qualifiedName));
75         return result;
76     }
77 }
78
Popular Tags