1. /*
  2. * The Apache Software License, Version 1.1
  3. *
  4. *
  5. * Copyright (c) 2003 The Apache Software Foundation. All rights
  6. * reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * 3. The end-user documentation included with the redistribution,
  21. * if any, must include the following acknowledgment:
  22. * "This product includes software developed by the
  23. * Apache Software Foundation (http://www.apache.org/)."
  24. * Alternately, this acknowledgment may appear in the software itself,
  25. * if and wherever such third-party acknowledgments normally appear.
  26. *
  27. * 4. The names "Xerces" and "Apache Software Foundation" must
  28. * not be used to endorse or promote products derived from this
  29. * software without prior written permission. For written
  30. * permission, please contact apache@apache.org.
  31. *
  32. * 5. Products derived from this software may not be called "Apache",
  33. * nor may "Apache" appear in their name, without prior written
  34. * permission of the Apache Software Foundation.
  35. *
  36. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  37. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  38. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  39. * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  40. * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  41. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  42. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  43. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  44. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  45. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  46. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  47. * SUCH DAMAGE.
  48. * ====================================================================
  49. *
  50. * This software consists of voluntary contributions made by many
  51. * individuals on behalf of the Apache Software Foundation and was
  52. * originally based on software copyright (c) 2003, International
  53. * Business Machines, Inc., http://www.apache.org. For more
  54. * information on the Apache Software Foundation, please see
  55. * <http://www.apache.org/>.
  56. */
  57. package com.sun.org.apache.xerces.internal.xs;
  58. /**
  59. * This interface represents an XML Schema.
  60. */
  61. public interface XSModel {
  62. /**
  63. * Convenience method. Returns a list of all namespaces that belong to
  64. * this schema. The value <code>null</code> is not a valid namespace
  65. * name, but if there are components that do not have a target namespace
  66. * , <code>null</code> is included in this list.
  67. */
  68. public StringList getNamespaces();
  69. /**
  70. * A set of namespace schema information information items (of type
  71. * <code>XSNamespaceItem</code>), one for each namespace name which
  72. * appears as the target namespace of any schema component in the schema
  73. * used for that assessment, and one for absent if any schema component
  74. * in the schema had no target namespace. For more information see
  75. * schema information.
  76. */
  77. public XSNamespaceItemList getNamespaceItems();
  78. /**
  79. * Returns a list of top-level components, i.e. element declarations,
  80. * attribute declarations, etc.
  81. * @param objectType The type of the declaration, i.e.
  82. * <code>ELEMENT_DECLARATION</code>. Note that
  83. * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
  84. * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
  85. * <code>objectType</code> to retrieve only complex types or simple
  86. * types, instead of all types.
  87. * @return A list of top-level definitions of the specified type in
  88. * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
  89. * such definitions exist.
  90. */
  91. public XSNamedMap getComponents(short objectType);
  92. /**
  93. * Convenience method. Returns a list of top-level component declarations
  94. * that are defined within the specified namespace, i.e. element
  95. * declarations, attribute declarations, etc.
  96. * @param objectType The type of the declaration, i.e.
  97. * <code>ELEMENT_DECLARATION</code>.
  98. * @param namespace The namespace to which the declaration belongs or
  99. * <code>null</code> (for components with no target namespace).
  100. * @return A list of top-level definitions of the specified type in
  101. * <code>objectType</code> and defined in the specified
  102. * <code>namespace</code> or an empty <code>XSNamedMap</code>.
  103. */
  104. public XSNamedMap getComponentsByNamespace(short objectType,
  105. String namespace);
  106. /**
  107. * [annotations]: a set of annotations if it exists, otherwise an empty
  108. * <code>XSObjectList</code>.
  109. */
  110. public XSObjectList getAnnotations();
  111. /**
  112. * Convenience method. Returns a top-level element declaration.
  113. * @param namespace The namespace of the declaration, otherwise
  114. * <code>null</code>.
  115. * @param name The name of the declaration.
  116. * @return A top-level element declaration or <code>null</code> if such a
  117. * declaration does not exist.
  118. */
  119. public XSElementDeclaration getElementDeclaration(String namespace,
  120. String name);
  121. /**
  122. * Convenience method. Returns a top-level attribute declaration.
  123. * @param namespace The namespace of the declaration, otherwise
  124. * <code>null</code>.
  125. * @param name The name of the declaration.
  126. * @return A top-level attribute declaration or <code>null</code> if such
  127. * a declaration does not exist.
  128. */
  129. public XSAttributeDeclaration getAttributeDeclaration(String namespace,
  130. String name);
  131. /**
  132. * Convenience method. Returns a top-level simple or complex type
  133. * definition.
  134. * @param namespace The namespace of the declaration, otherwise
  135. * <code>null</code>.
  136. * @param name The name of the definition.
  137. * @return An <code>XSTypeDefinition</code> or <code>null</code> if such
  138. * a definition does not exist.
  139. */
  140. public XSTypeDefinition getTypeDefinition(String namespace,
  141. String name);
  142. /**
  143. * Convenience method. Returns a top-level attribute group definition.
  144. * @param namespace The namespace of the definition, otherwise
  145. * <code>null</code>.
  146. * @param name The name of the definition.
  147. * @return A top-level attribute group definition or <code>null</code> if
  148. * such a definition does not exist.
  149. */
  150. public XSAttributeGroupDefinition getAttributeGroup(String namespace,
  151. String name);
  152. /**
  153. * Convenience method. Returns a top-level model group definition.
  154. * @param namespace The namespace of the definition, otherwise
  155. * <code>null</code>.
  156. * @param name The name of the definition.
  157. * @return A top-level model group definition or <code>null</code> if
  158. * such a definition does not exist.
  159. */
  160. public XSModelGroupDefinition getModelGroupDefinition(String namespace,
  161. String name);
  162. /**
  163. * Convenience method. Returns a top-level notation declaration.
  164. * @param namespace The namespace of the declaration, otherwise
  165. * <code>null</code>.
  166. * @param name The name of the declaration.
  167. * @return A top-level notation declaration or <code>null</code> if such
  168. * a declaration does not exist.
  169. */
  170. public XSNotationDeclaration getNotationDeclaration(String namespace,
  171. String name);
  172. }