001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.xerces.dom;
019:
020: import org.w3c.dom.DOMException;
021: import org.w3c.dom.DOMImplementation;
022:
023: import org.apache.xerces.dom3.as.DOMImplementationAS;
024: import org.apache.xerces.dom3.as.ASModel;
025: import org.apache.xerces.dom3.as.DOMASBuilder;
026: import org.apache.xerces.dom3.as.DOMASWriter;
027: import org.apache.xerces.parsers.DOMASBuilderImpl;
028:
029: /**
030: * The DOMImplementation class is description of a particular
031: * implementation of the Document Object Model. As such its data is
032: * static, shared by all instances of this implementation.
033: * <P>
034: * The DOM API requires that it be a real object rather than static
035: * methods. However, there's nothing that says it can't be a singleton,
036: * so that's how I've implemented it.
037: * <P>
038: * This particular class, along with DocumentImpl, supports the DOM
039: * Core, DOM Level 2 optional mofules, and Abstract Schemas (Experimental).
040: * @deprecated
041: * @version $Id: ASDOMImplementationImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
042: * @since PR-DOM-Level-1-19980818.
043: */
044: public class ASDOMImplementationImpl extends DOMImplementationImpl
045: implements DOMImplementationAS {
046:
047: // static
048:
049: /** Dom implementation singleton. */
050: static ASDOMImplementationImpl singleton = new ASDOMImplementationImpl();
051:
052: //
053: // Public methods
054: //
055:
056: /** NON-DOM: Obtain and return the single shared object */
057: public static DOMImplementation getDOMImplementation() {
058: return singleton;
059: }
060:
061: //
062: // DOM L3 Abstract Schemas:
063: // REVISIT: implement hasFeature()
064: //
065:
066: /**
067: * DOM Level 3 WD - Experimental.
068: * Creates an ASModel.
069: * @param isNamespaceAware Allow creation of <code>ASModel</code> with
070: * this attribute set to a specific value.
071: * @return A <code>null</code> return indicates failure.what is a
072: * failure? Could be a system error.
073: */
074: public ASModel createAS(boolean isNamespaceAware) {
075: return new ASModelImpl(isNamespaceAware);
076: }
077:
078: /**
079: * DOM Level 3 WD - Experimental.
080: * Creates an <code>DOMASBuilder</code>.Do we need the method since we
081: * already have <code>DOMImplementationLS.createDOMParser</code>?
082: * @return DOMASBuilder
083: */
084: public DOMASBuilder createDOMASBuilder() {
085: return new DOMASBuilderImpl();
086: }
087:
088: /**
089: * DOM Level 3 WD - Experimental.
090: * Creates an <code>DOMASWriter</code>.
091: * @return a DOMASWriter
092: */
093: public DOMASWriter createDOMASWriter() {
094: String msg = DOMMessageFormatter.formatMessage(
095: DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR",
096: null);
097: throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
098: }
099:
100: } // class DOMImplementationImpl
|