KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xs > XSModel


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.xs;
18
19 /**
20  * This interface represents an XML Schema.
21  */

22 public interface XSModel {
23     /**
24      * Convenience method. Returns a list of all namespaces that belong to
25      * this schema. The value <code>null</code> is not a valid namespace
26      * name, but if there are components that do not have a target namespace
27      * , <code>null</code> is included in this list.
28      */

29     public StringList getNamespaces();
30
31     /**
32      * A set of namespace schema information information items (of type
33      * <code>XSNamespaceItem</code>), one for each namespace name which
34      * appears as the target namespace of any schema component in the schema
35      * used for that assessment, and one for absent if any schema component
36      * in the schema had no target namespace. For more information see
37      * schema information.
38      */

39     public XSNamespaceItemList getNamespaceItems();
40
41     /**
42      * Returns a list of top-level components, i.e. element declarations,
43      * attribute declarations, etc.
44      * @param objectType The type of the declaration, i.e.
45      * <code>ELEMENT_DECLARATION</code>. Note that
46      * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
47      * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
48      * <code>objectType</code> to retrieve only complex types or simple
49      * types, instead of all types.
50      * @return A list of top-level definitions of the specified type in
51      * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
52      * such definitions exist.
53      */

54     public XSNamedMap getComponents(short objectType);
55
56     /**
57      * Convenience method. Returns a list of top-level component declarations
58      * that are defined within the specified namespace, i.e. element
59      * declarations, attribute declarations, etc.
60      * @param objectType The type of the declaration, i.e.
61      * <code>ELEMENT_DECLARATION</code>.
62      * @param namespace The namespace to which the declaration belongs or
63      * <code>null</code> (for components with no target namespace).
64      * @return A list of top-level definitions of the specified type in
65      * <code>objectType</code> and defined in the specified
66      * <code>namespace</code> or an empty <code>XSNamedMap</code>.
67      */

68     public XSNamedMap getComponentsByNamespace(short objectType,
69                                                String JavaDoc namespace);
70
71     /**
72      * [annotations]: a set of annotations if it exists, otherwise an empty
73      * <code>XSObjectList</code>.
74      */

75     public XSObjectList getAnnotations();
76
77     /**
78      * Convenience method. Returns a top-level element declaration.
79      * @param name The name of the declaration.
80      * @param namespace The namespace of the declaration, otherwise
81      * <code>null</code>.
82      * @return A top-level element declaration or <code>null</code> if such a
83      * declaration does not exist.
84      */

85     public XSElementDeclaration getElementDeclaration(String JavaDoc name,
86                                                       String JavaDoc namespace);
87
88     /**
89      * Convenience method. Returns a top-level attribute declaration.
90      * @param name The name of the declaration.
91      * @param namespace The namespace of the declaration, otherwise
92      * <code>null</code>.
93      * @return A top-level attribute declaration or <code>null</code> if such
94      * a declaration does not exist.
95      */

96     public XSAttributeDeclaration getAttributeDeclaration(String JavaDoc name,
97                                                           String JavaDoc namespace);
98
99     /**
100      * Convenience method. Returns a top-level simple or complex type
101      * definition.
102      * @param name The name of the definition.
103      * @param namespace The namespace of the declaration, otherwise
104      * <code>null</code>.
105      * @return An <code>XSTypeDefinition</code> or <code>null</code> if such
106      * a definition does not exist.
107      */

108     public XSTypeDefinition getTypeDefinition(String JavaDoc name,
109                                               String JavaDoc namespace);
110
111     /**
112      * Convenience method. Returns a top-level attribute group definition.
113      * @param name The name of the definition.
114      * @param namespace The namespace of the definition, otherwise
115      * <code>null</code>.
116      * @return A top-level attribute group definition or <code>null</code> if
117      * such a definition does not exist.
118      */

119     public XSAttributeGroupDefinition getAttributeGroup(String JavaDoc name,
120                                                         String JavaDoc namespace);
121
122     /**
123      * Convenience method. Returns a top-level model group definition.
124      * @param name The name of the definition.
125      * @param namespace The namespace of the definition, otherwise
126      * <code>null</code>.
127      * @return A top-level model group definition or <code>null</code> if
128      * such a definition does not exist.
129      */

130     public XSModelGroupDefinition getModelGroupDefinition(String JavaDoc name,
131                                                           String JavaDoc namespace);
132
133     /**
134      * Convenience method. Returns a top-level notation declaration.
135      * @param name The name of the declaration.
136      * @param namespace The namespace of the declaration, otherwise
137      * <code>null</code>.
138      * @return A top-level notation declaration or <code>null</code> if such
139      * a declaration does not exist.
140      */

141     public XSNotationDeclaration getNotationDeclaration(String JavaDoc name,
142                                                         String JavaDoc namespace);
143
144 }
145
Popular Tags