1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      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 com.sun.org.apache.xerces.internal.jaxp.validation;
19 
20 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
21 
22 /**
23  * <p>Implementation of Schema for W3C XML Schemas.</p>
24  *
25  * @author Michael Glavassevich, IBM
26  */
27 final class XMLSchema extends AbstractXMLSchema {
28 
29     /** The grammar pool is immutable */
30     private final XMLGrammarPool fGrammarPool;
31 
32     /** Whether to consider this schema to be fully composed */
33     private final boolean fFullyComposed;
34 
35     /** Constructor */
XMLSchema(XMLGrammarPool grammarPool)36     public XMLSchema(XMLGrammarPool grammarPool) {
37         this(grammarPool, true);
38     }
39 
XMLSchema(XMLGrammarPool grammarPool, boolean fullyComposed)40     public XMLSchema(XMLGrammarPool grammarPool, boolean fullyComposed) {
41          fGrammarPool = grammarPool;
42         fFullyComposed = fullyComposed;
43      }
44 
45     /*
46      * XSGrammarPoolContainer methods
47      */
48 
49     /**
50      * <p>Returns the grammar pool contained inside the container.</p>
51      *
52      * @return the grammar pool contained inside the container
53      */
getGrammarPool()54     public XMLGrammarPool getGrammarPool() {
55         return fGrammarPool;
56     }
57 
58     /**
59      * <p>Returns whether the schema components contained in this object
60      * can be considered to be a fully composed schema and should be
61      * used to exclusion of other schema components which may be
62      * present elsewhere.</p>
63      *
64      * @return whether the schema components contained in this object
65      * can be considered to be a fully composed schema
66      */
isFullyComposed()67     public boolean isFullyComposed() {
68         return fFullyComposed;
69     }
70 
71 } // XMLSchema
72