01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.xerces.jaxp.validation;
19:
20: import org.apache.xerces.xni.grammars.Grammar;
21: import org.apache.xerces.xni.grammars.XMLGrammarDescription;
22: import org.apache.xerces.xni.grammars.XMLGrammarPool;
23:
24: /**
25: * <p>Implementation of Schema for W3C XML Schemas
26: * which contains no schema components.</p>
27: *
28: * @author Michael Glavassevich, IBM
29: * @version $Id: EmptyXMLSchema.java 447235 2006-09-18 05:01:44Z mrglavas $
30: */
31: final class EmptyXMLSchema extends AbstractXMLSchema implements
32: XMLGrammarPool {
33:
34: /** Zero length grammar array. */
35: private static final Grammar[] ZERO_LENGTH_GRAMMAR_ARRAY = new Grammar[0];
36:
37: public EmptyXMLSchema() {
38: }
39:
40: /*
41: * XMLGrammarPool methods
42: */
43:
44: public Grammar[] retrieveInitialGrammarSet(String grammarType) {
45: return ZERO_LENGTH_GRAMMAR_ARRAY;
46: }
47:
48: public void cacheGrammars(String grammarType, Grammar[] grammars) {
49: }
50:
51: public Grammar retrieveGrammar(XMLGrammarDescription desc) {
52: return null;
53: }
54:
55: public void lockPool() {
56: }
57:
58: public void unlockPool() {
59: }
60:
61: public void clear() {
62: }
63:
64: /*
65: * XSGrammarPoolContainer methods
66: */
67:
68: public XMLGrammarPool getGrammarPool() {
69: return this ;
70: }
71:
72: public boolean isFullyComposed() {
73: return true;
74: }
75:
76: } // EmptyXMLSchema
|