KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > dom > ASDOMImplementationImpl


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

16
17 package org.apache.xerces.dom;
18
19 import org.w3c.dom.DOMException JavaDoc;
20 import org.w3c.dom.DOMImplementation JavaDoc;
21
22 import org.apache.xerces.dom3.as.DOMImplementationAS;
23 import org.apache.xerces.dom3.as.ASModel;
24 import org.apache.xerces.dom3.as.DOMASBuilder;
25 import org.apache.xerces.dom3.as.DOMASWriter;
26 import org.apache.xerces.parsers.DOMASBuilderImpl;
27
28
29
30 /**
31  * The DOMImplementation class is description of a particular
32  * implementation of the Document Object Model. As such its data is
33  * static, shared by all instances of this implementation.
34  * <P>
35  * The DOM API requires that it be a real object rather than static
36  * methods. However, there's nothing that says it can't be a singleton,
37  * so that's how I've implemented it.
38  * <P>
39  * This particular class, along with DocumentImpl, supports the DOM
40  * Core, DOM Level 2 optional mofules, and Abstract Schemas (Experimental).
41  * @deprecated
42  * @version $Id: ASDOMImplementationImpl.java,v 1.6 2004/02/24 23:23:17 mrglavas Exp $
43  * @since PR-DOM-Level-1-19980818.
44  */

45 public class ASDOMImplementationImpl extends DOMImplementationImpl
46     implements DOMImplementationAS {
47
48
49     // static
50

51     /** Dom implementation singleton. */
52     static ASDOMImplementationImpl singleton = new ASDOMImplementationImpl();
53
54
55     //
56
// Public methods
57
//
58

59     /** NON-DOM: Obtain and return the single shared object */
60     public static DOMImplementation JavaDoc getDOMImplementation() {
61         return singleton;
62     }
63
64     //
65
// DOM L3 Abstract Schemas:
66
// REVISIT: implement hasFeature()
67
//
68

69     /**
70      * DOM Level 3 WD - Experimental.
71      * Creates an ASModel.
72      * @param isNamespaceAware Allow creation of <code>ASModel</code> with
73      * this attribute set to a specific value.
74      * @return A <code>null</code> return indicates failure.what is a
75      * failure? Could be a system error.
76      */

77     public ASModel createAS(boolean isNamespaceAware){
78         return new ASModelImpl(isNamespaceAware);
79     }
80
81     /**
82      * DOM Level 3 WD - Experimental.
83      * Creates an <code>DOMASBuilder</code>.Do we need the method since we
84      * already have <code>DOMImplementationLS.createDOMParser</code>?
85      * @return DOMASBuilder
86      */

87     public DOMASBuilder createDOMASBuilder(){
88         return new DOMASBuilderImpl();
89     }
90
91
92     /**
93      * DOM Level 3 WD - Experimental.
94      * Creates an <code>DOMASWriter</code>.
95      * @return a DOMASWriter
96      */

97     public DOMASWriter createDOMASWriter(){
98         String JavaDoc msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
99         throw new DOMException JavaDoc(DOMException.NOT_SUPPORTED_ERR, msg);
100     }
101     
102
103
104 } // class DOMImplementationImpl
105
Popular Tags