1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 package com.sun.org.apache.xerces.internal.jaxp.validation; 23 24 import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; 25 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; 26 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; 27 28 /** 29 * <p>Implementation of Schema for W3C XML Schemas 30 * which contains no schema components.</p> 31 * 32 * @author Michael Glavassevich, IBM 33 */ 34 final class EmptyXMLSchema extends AbstractXMLSchema implements XMLGrammarPool { 35 36 /** Zero length grammar array. */ 37 private static final Grammar [] ZERO_LENGTH_GRAMMAR_ARRAY = new Grammar [0]; 38 EmptyXMLSchema()39 public EmptyXMLSchema() {} 40 41 /* 42 * XMLGrammarPool methods 43 */ 44 retrieveInitialGrammarSet(String grammarType)45 public Grammar[] retrieveInitialGrammarSet(String grammarType) { 46 return ZERO_LENGTH_GRAMMAR_ARRAY; 47 } 48 cacheGrammars(String grammarType, Grammar[] grammars)49 public void cacheGrammars(String grammarType, Grammar[] grammars) {} 50 retrieveGrammar(XMLGrammarDescription desc)51 public Grammar retrieveGrammar(XMLGrammarDescription desc) { 52 return null; 53 } 54 lockPool()55 public void lockPool() {} 56 unlockPool()57 public void unlockPool() {} 58 clear()59 public void clear() {} 60 61 /* 62 * XSGrammarPoolContainer methods 63 */ 64 getGrammarPool()65 public XMLGrammarPool getGrammarPool() { 66 return this; 67 } 68 isFullyComposed()69 public boolean isFullyComposed() { 70 return true; 71 } 72 73 } // EmptyXMLSchema 74