1 /*
2  * reserved comment block
3  * DO NOT REMOVE OR ALTER!
4  */
5 /*
6  * Copyright 2003,2004 The Apache Software Foundation.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 package com.sun.org.apache.xerces.internal.xs;
22 
23 /**
24  * This interface represents an XML Schema.
25  */
26 public interface XSModel {
27     /**
28      * Convenience method. Returns a list of all namespaces that belong to
29      * this schema. The value <code>null</code> is not a valid namespace
30      * name, but if there are components that do not have a target namespace
31      * , <code>null</code> is included in this list.
32      */
getNamespaces()33     public StringList getNamespaces();
34 
35     /**
36      * A set of namespace schema information information items (of type
37      * <code>XSNamespaceItem</code>), one for each namespace name which
38      * appears as the target namespace of any schema component in the schema
39      * used for that assessment, and one for absent if any schema component
40      * in the schema had no target namespace. For more information see
41      * schema information.
42      */
getNamespaceItems()43     public XSNamespaceItemList getNamespaceItems();
44 
45     /**
46      * Returns a list of top-level components, i.e. element declarations,
47      * attribute declarations, etc.
48      * @param objectType The type of the declaration, i.e.
49      *   <code>ELEMENT_DECLARATION</code>. Note that
50      *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and
51      *   <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
52      *   <code>objectType</code> to retrieve only complex types or simple
53      *   types, instead of all types.
54      * @return  A list of top-level definitions of the specified type in
55      *   <code>objectType</code> or an empty <code>XSNamedMap</code> if no
56      *   such definitions exist.
57      */
getComponents(short objectType)58     public XSNamedMap getComponents(short objectType);
59 
60     /**
61      * Convenience method. Returns a list of top-level component declarations
62      * that are defined within the specified namespace, i.e. element
63      * declarations, attribute declarations, etc.
64      * @param objectType The type of the declaration, i.e.
65      *   <code>ELEMENT_DECLARATION</code>.
66      * @param namespace The namespace to which the declaration belongs or
67      *   <code>null</code> (for components with no target namespace).
68      * @return  A list of top-level definitions of the specified type in
69      *   <code>objectType</code> and defined in the specified
70      *   <code>namespace</code> or an empty <code>XSNamedMap</code>.
71      */
getComponentsByNamespace(short objectType, String namespace)72     public XSNamedMap getComponentsByNamespace(short objectType,
73                                                String namespace);
74 
75     /**
76      *  [annotations]: a set of annotations if it exists, otherwise an empty
77      * <code>XSObjectList</code>.
78      */
getAnnotations()79     public XSObjectList getAnnotations();
80 
81     /**
82      * Convenience method. Returns a top-level element declaration.
83      * @param name The name of the declaration.
84      * @param namespace The namespace of the declaration, otherwise
85      *   <code>null</code>.
86      * @return A top-level element declaration or <code>null</code> if such a
87      *   declaration does not exist.
88      */
getElementDeclaration(String name, String namespace)89     public XSElementDeclaration getElementDeclaration(String name,
90                                                       String namespace);
91 
92     /**
93      * Convenience method. Returns a top-level attribute declaration.
94      * @param name The name of the declaration.
95      * @param namespace The namespace of the declaration, otherwise
96      *   <code>null</code>.
97      * @return A top-level attribute declaration or <code>null</code> if such
98      *   a declaration does not exist.
99      */
getAttributeDeclaration(String name, String namespace)100     public XSAttributeDeclaration getAttributeDeclaration(String name,
101                                                           String namespace);
102 
103     /**
104      * Convenience method. Returns a top-level simple or complex type
105      * definition.
106      * @param name The name of the definition.
107      * @param namespace The namespace of the declaration, otherwise
108      *   <code>null</code>.
109      * @return An <code>XSTypeDefinition</code> or <code>null</code> if such
110      *   a definition does not exist.
111      */
getTypeDefinition(String name, String namespace)112     public XSTypeDefinition getTypeDefinition(String name,
113                                               String namespace);
114 
115     /**
116      * Convenience method. Returns a top-level attribute group definition.
117      * @param name The name of the definition.
118      * @param namespace The namespace of the definition, otherwise
119      *   <code>null</code>.
120      * @return A top-level attribute group definition or <code>null</code> if
121      *   such a definition does not exist.
122      */
getAttributeGroup(String name, String namespace)123     public XSAttributeGroupDefinition getAttributeGroup(String name,
124                                                         String namespace);
125 
126     /**
127      * Convenience method. Returns a top-level model group definition.
128      * @param name The name of the definition.
129      * @param namespace The namespace of the definition, otherwise
130      *   <code>null</code>.
131      * @return A top-level model group definition or <code>null</code> if
132      *   such a definition does not exist.
133      */
getModelGroupDefinition(String name, String namespace)134     public XSModelGroupDefinition getModelGroupDefinition(String name,
135                                                           String namespace);
136 
137     /**
138      * Convenience method. Returns a top-level notation declaration.
139      * @param name The name of the declaration.
140      * @param namespace The namespace of the declaration, otherwise
141      *   <code>null</code>.
142      * @return A top-level notation declaration or <code>null</code> if such
143      *   a declaration does not exist.
144      */
getNotationDeclaration(String name, String namespace)145     public XSNotationDeclaration getNotationDeclaration(String name,
146                                                         String namespace);
147 
148     /**
149      * Convenience method. Returns a list containing the members of the
150      * substitution group for the given <code>XSElementDeclaration</code>
151      * or an empty <code>XSObjectList</code> if the substitution group
152      * contains no members.
153      * @param head The substitution group head.
154      * @return A list containing the members of the substitution group
155      *  for the given <code>XSElementDeclaration</code> or an empty
156      *  <code>XSObjectList</code> if the substitution group contains
157      *  no members.
158      */
getSubstitutionGroup(XSElementDeclaration head)159     public XSObjectList getSubstitutionGroup(XSElementDeclaration head);
160 
161 }
162