001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.xerces.xs;
019:
020: /**
021: * This interface represents an XML Schema.
022: */
023: public interface XSModel {
024: /**
025: * Convenience method. Returns a list of all namespaces that belong to
026: * this schema. The value <code>null</code> is not a valid namespace
027: * name, but if there are components that do not have a target namespace
028: * , <code>null</code> is included in this list.
029: */
030: public StringList getNamespaces();
031:
032: /**
033: * A set of namespace schema information information items (of type
034: * <code>XSNamespaceItem</code>), one for each namespace name which
035: * appears as the target namespace of any schema component in the schema
036: * used for that assessment, and one for absent if any schema component
037: * in the schema had no target namespace. For more information see
038: * schema information.
039: */
040: public XSNamespaceItemList getNamespaceItems();
041:
042: /**
043: * Returns a list of top-level components, i.e. element declarations,
044: * attribute declarations, etc.
045: * @param objectType The type of the declaration, i.e.
046: * <code>ELEMENT_DECLARATION</code>. Note that
047: * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
048: * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
049: * <code>objectType</code> to retrieve only complex types or simple
050: * types, instead of all types.
051: * @return A list of top-level definitions of the specified type in
052: * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
053: * such definitions exist.
054: */
055: public XSNamedMap getComponents(short objectType);
056:
057: /**
058: * Convenience method. Returns a list of top-level component declarations
059: * that are defined within the specified namespace, i.e. element
060: * declarations, attribute declarations, etc.
061: * @param objectType The type of the declaration, i.e.
062: * <code>ELEMENT_DECLARATION</code>.
063: * @param namespace The namespace to which the declaration belongs or
064: * <code>null</code> (for components with no target namespace).
065: * @return A list of top-level definitions of the specified type in
066: * <code>objectType</code> and defined in the specified
067: * <code>namespace</code> or an empty <code>XSNamedMap</code>.
068: */
069: public XSNamedMap getComponentsByNamespace(short objectType,
070: String namespace);
071:
072: /**
073: * [annotations]: a set of annotations if it exists, otherwise an empty
074: * <code>XSObjectList</code>.
075: */
076: public XSObjectList getAnnotations();
077:
078: /**
079: * Convenience method. Returns a top-level element declaration.
080: * @param name The name of the declaration.
081: * @param namespace The namespace of the declaration, otherwise
082: * <code>null</code>.
083: * @return A top-level element declaration or <code>null</code> if such a
084: * declaration does not exist.
085: */
086: public XSElementDeclaration getElementDeclaration(String name,
087: String namespace);
088:
089: /**
090: * Convenience method. Returns a top-level attribute declaration.
091: * @param name The name of the declaration.
092: * @param namespace The namespace of the declaration, otherwise
093: * <code>null</code>.
094: * @return A top-level attribute declaration or <code>null</code> if such
095: * a declaration does not exist.
096: */
097: public XSAttributeDeclaration getAttributeDeclaration(String name,
098: String namespace);
099:
100: /**
101: * Convenience method. Returns a top-level simple or complex type
102: * definition.
103: * @param name The name of the definition.
104: * @param namespace The namespace of the declaration, otherwise
105: * <code>null</code>.
106: * @return An <code>XSTypeDefinition</code> or <code>null</code> if such
107: * a definition does not exist.
108: */
109: public XSTypeDefinition getTypeDefinition(String name,
110: String namespace);
111:
112: /**
113: * Convenience method. Returns a top-level attribute group definition.
114: * @param name The name of the definition.
115: * @param namespace The namespace of the definition, otherwise
116: * <code>null</code>.
117: * @return A top-level attribute group definition or <code>null</code> if
118: * such a definition does not exist.
119: */
120: public XSAttributeGroupDefinition getAttributeGroup(String name,
121: String namespace);
122:
123: /**
124: * Convenience method. Returns a top-level model group definition.
125: * @param name The name of the definition.
126: * @param namespace The namespace of the definition, otherwise
127: * <code>null</code>.
128: * @return A top-level model group definition or <code>null</code> if
129: * such a definition does not exist.
130: */
131: public XSModelGroupDefinition getModelGroupDefinition(String name,
132: String namespace);
133:
134: /**
135: * Convenience method. Returns a top-level notation declaration.
136: * @param name The name of the declaration.
137: * @param namespace The namespace of the declaration, otherwise
138: * <code>null</code>.
139: * @return A top-level notation declaration or <code>null</code> if such
140: * a declaration does not exist.
141: */
142: public XSNotationDeclaration getNotationDeclaration(String name,
143: String namespace);
144:
145: /**
146: * Convenience method. Returns a list containing the members of the
147: * substitution group for the given <code>XSElementDeclaration</code>
148: * or an empty <code>XSObjectList</code> if the substitution group
149: * contains no members.
150: * @param head The substitution group head.
151: * @return A list containing the members of the substitution group
152: * for the given <code>XSElementDeclaration</code> or an empty
153: * <code>XSObjectList</code> if the substitution group contains
154: * no members.
155: */
156: public XSObjectList getSubstitutionGroup(XSElementDeclaration head);
157:
158: }
|