286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Licensed to the Apache Software Foundation (ASF) under one or more
286N/A * contributor license agreements. See the NOTICE file distributed with
286N/A * this work for additional information regarding copyright ownership.
286N/A * The ASF licenses this file to You under the Apache License, Version 2.0
286N/A * (the "License"); you may not use this file except in compliance with
286N/A * the License. You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.impl.xs.opti;
286N/Aimport org.w3c.dom.DOMException;
286N/Aimport org.w3c.dom.DOMImplementation;
286N/Aimport org.w3c.dom.Document;
286N/Aimport org.w3c.dom.DocumentType;
286N/A
286N/A/**
286N/A * @xerces.internal
286N/A *
286N/A * @version $Id: SchemaDOMImplementation.java,v 1.2 2010-10-26 23:01:18 joehw Exp $
286N/A */
286N/Afinal class SchemaDOMImplementation implements DOMImplementation {
286N/A
286N/A private static final SchemaDOMImplementation singleton = new SchemaDOMImplementation();
286N/A
286N/A /** NON-DOM: Obtain and return the single shared object */
286N/A public static DOMImplementation getDOMImplementation() {
286N/A return singleton;
286N/A }
286N/A
286N/A private SchemaDOMImplementation() {}
286N/A
286N/A public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype)
286N/A throws DOMException {
286N/A throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
286N/A }
286N/A
286N/A public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId)
286N/A throws DOMException {
286N/A throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
286N/A }
286N/A
286N/A public Object getFeature(String feature, String version) {
286N/A if (singleton.hasFeature(feature, version)) {
286N/A return singleton;
286N/A }
286N/A return null;
286N/A }
286N/A
286N/A public boolean hasFeature(String feature, String version) {
286N/A final boolean anyVersion = version == null || version.length() == 0;
286N/A return (feature.equalsIgnoreCase("Core") || feature.equalsIgnoreCase("XML")) &&
286N/A (anyVersion || version.equals("1.0") || version.equals("2.0") || version.equals("3.0"));
286N/A }
286N/A
286N/A}