1. /*
  2. * Copyright (c) 2001 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE.
  10. * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11. */
  12. package com.sun.org.apache.xerces.internal.dom3.as;
  13. import org.w3c.dom.DOMException;
  14. /**
  15. * @deprecated
  16. * To begin with, an abstract schema is a generic structure that could
  17. * contain both internal and external subsets. An <code>ASModel</code> is an
  18. * abstract object that could map to a DTD , an XML Schema , a database
  19. * schema, etc. An <code>ASModel</code> could represent either an internal
  20. * or an external subset; hence an abstract schema could be composed of an
  21. * <code>ASModel</code> representing the internal subset and an
  22. * <code>ASModel</code> representing the external subset. Note that the
  23. * <code>ASModel</code> representing the external subset could consult the
  24. * <code>ASModel</code> representing the internal subset. Furthermore, the
  25. * <code>ASModel</code> representing the internal subset could be set to
  26. * null by the <code>setInternalAS</code> method as a mechanism for
  27. * "removal". In addition, only one <code>ASModel</code> representing the
  28. * external subset can be specified as "active" and it is possible that none
  29. * are "active". Finally, the <code>ASModel</code> contains the factory
  30. * methods needed to create a various types of ASObjects like
  31. * <code>ASElementDeclaration</code>, <code>ASAttributeDeclaration</code>,
  32. * etc.
  33. * <p>See also the <a href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model (DOM) Level 3 Abstract Schemas and Load
  34. and Save Specification</a>.
  35. */
  36. public interface ASModel extends ASObject {
  37. /**
  38. * <code>true</code> if this <code>ASModel</code> defines the document
  39. * structure in terms of namespaces and local names ; <code>false</code>
  40. * if the document structure is defined only in terms of
  41. * <code>QNames</code>.
  42. */
  43. public boolean getIsNamespaceAware();
  44. /**
  45. * 0 if used internally, 1 if used externally, 2 if not all. An exception
  46. * will be raised if it is incompatibly shared or in use as an internal
  47. * subset.
  48. */
  49. public short getUsageLocation();
  50. /**
  51. * The URI reference.
  52. */
  53. public String getAsLocation();
  54. /**
  55. * The URI reference.
  56. */
  57. public void setAsLocation(String asLocation);
  58. /**
  59. * The hint to locating an ASModel.
  60. */
  61. public String getAsHint();
  62. /**
  63. * The hint to locating an ASModel.
  64. */
  65. public void setAsHint(String asHint);
  66. /**
  67. * Instead of returning an all-in-one <code>ASObject</code> with
  68. * <code>ASModel</code> methods, have discernible top-level/"global"
  69. * element declarations. If one attempts to add, set, or remove a node
  70. * type other than the intended one, a hierarchy exception (or
  71. * equivalent is thrown).
  72. */
  73. public ASNamedObjectMap getElementDeclarations();
  74. /**
  75. * Instead of returning an all-in-one <code>ASObject</code> with
  76. * <code>ASModel</code> methods, have discernible top-level/"global"
  77. * attribute declarations. If one attempts to add, set, or remove a node
  78. * type other than the intended one, a hierarchy exception (or
  79. * equivalent is thrown).
  80. */
  81. public ASNamedObjectMap getAttributeDeclarations();
  82. /**
  83. * Instead of returning an all-in-one <code>ASObject</code> with
  84. * <code>ASModel</code> methods, have discernible top-level/"global"
  85. * notation declarations. If one attempts to add, set, or remove a node
  86. * type other than the intended one, a hierarchy exception (or
  87. * equivalent is thrown).
  88. */
  89. public ASNamedObjectMap getNotationDeclarations();
  90. /**
  91. * Instead of returning an all-in-one <code>ASObject</code> with
  92. * <code>ASModel</code> methods, have discernible top-level/"global"
  93. * entity declarations. If one attempts to add, set, or remove a node
  94. * type other than the intended one, a hierarchy exception (or
  95. * equivalent is thrown).
  96. */
  97. public ASNamedObjectMap getEntityDeclarations();
  98. /**
  99. * Instead of returning an all-in-one <code>ASObject</code> with
  100. * <code>ASModel</code> methods, have discernible top-level/"global
  101. * content model declarations. If one attempts to add, set, or remove a
  102. * node type other than the intended one, a hierarchy exception (or
  103. * equivalent is thrown).
  104. */
  105. public ASNamedObjectMap getContentModelDeclarations();
  106. /**
  107. * This method will allow the nesting or "importation" of ASModels.
  108. * @param abstractSchema ASModel to be set. Subsequent calls will nest
  109. * the ASModels within the specified <code>ownerASModel</code>.
  110. */
  111. public void addASModel(ASModel abstractSchema);
  112. /**
  113. * To retrieve a list of nested ASModels without reference to names.
  114. * @return A list of ASModels.
  115. */
  116. public ASObjectList getASModels();
  117. /**
  118. * Removes only the specified <code>ASModel</code> from the list of
  119. * <code>ASModel</code>s.
  120. * @param as AS to be removed.
  121. */
  122. public void removeAS(ASModel as);
  123. /**
  124. * Determines if an <code>ASModel</code> itself is valid, i.e., confirming
  125. * that it's well-formed and valid per its own formal grammar.
  126. * @return <code>true</code> if the <code>ASModel</code> is valid,
  127. * <code>false</code> otherwise.
  128. */
  129. public boolean validate();
  130. /**
  131. * Creates an element declaration for the element type specified.
  132. * @param namespaceURI The <code>namespace URI</code> of the element type
  133. * being declared.
  134. * @param name The name of the element. The format of the name could be
  135. * an NCName as defined by XML Namespaces or a Name as defined by XML
  136. * 1.0; it's ASModel-dependent.
  137. * @return A new <code>ASElementDeclaration</code> object with
  138. * <code>name</code> attribute set to <code>tagname</code> and
  139. * <code>namespaceURI</code> set to <code>systemId</code>. Other
  140. * attributes of the element declaration are set through
  141. * <code>ASElementDeclaration</code> interface methods.
  142. * @exception DOMException
  143. * INVALID_CHARACTER_ERR: Raised if the specified name contains an
  144. * illegal character.
  145. */
  146. public ASElementDeclaration createASElementDeclaration(String namespaceURI,
  147. String name)
  148. throws DOMException;
  149. /**
  150. * Creates an attribute declaration.
  151. * @param namespaceURI The namespace URI of the attribute being declared.
  152. * @param name The name of the attribute. The format of the name could be
  153. * an NCName as defined by XML Namespaces or a Name as defined by XML
  154. * 1.0; it's ASModel-dependent.
  155. * @return A new <code>ASAttributeDeclaration</code> object with
  156. * appropriate attributes set by input parameters.
  157. * @exception DOMException
  158. * INVALID_CHARACTER_ERR: Raised if the input <code>name</code>
  159. * parameter contains an illegal character.
  160. */
  161. public ASAttributeDeclaration createASAttributeDeclaration(String namespaceURI,
  162. String name)
  163. throws DOMException;
  164. /**
  165. * Creates a new notation declaration.
  166. * @param namespaceURI The namespace URI of the notation being declared.
  167. * @param name The name of the notation. The format of the name could be
  168. * an NCName as defined by XML Namespaces or a Name as defined by XML
  169. * 1.0; it's ASModel-dependent.
  170. * @param systemId The system identifier for the notation declaration.
  171. * @param publicId The public identifier for the notation declaration.
  172. * @return A new <code>ASNotationDeclaration</code> object with
  173. * <code>notationName</code> attribute set to <code>name</code> and
  174. * <code>publicId</code> and <code>systemId</code> set to the
  175. * corresponding fields.
  176. * @exception DOMException
  177. * INVALID_CHARACTER_ERR: Raised if the specified name contains an
  178. * illegal character.
  179. */
  180. public ASNotationDeclaration createASNotationDeclaration(String namespaceURI,
  181. String name,
  182. String systemId,
  183. String publicId)
  184. throws DOMException;
  185. /**
  186. * Creates an ASEntityDeclaration.
  187. * @param name The name of the entity being declared.
  188. * @return A new <code>ASEntityDeclaration</code> object with
  189. * <code>entityName</code> attribute set to name.
  190. * @exception DOMException
  191. * INVALID_CHARACTER_ERR: Raised if the specified name contains an
  192. * illegal character.
  193. */
  194. public ASEntityDeclaration createASEntityDeclaration(String name)
  195. throws DOMException;
  196. /**
  197. * Creates an object which describes part of an
  198. * <code>ASElementDeclaration</code>'s content model.
  199. * @param minOccurs The minimum occurrence for the subModels of this
  200. * <code>ASContentModel</code>.
  201. * @param maxOccurs The maximum occurrence for the subModels of this
  202. * <code>ASContentModel</code>.
  203. * @param operator operator of type <code>AS_CHOICE</code>,
  204. * <code>AS_SEQUENCE</code>, <code>AS_ALL</code> or
  205. * <code>AS_NONE</code>.
  206. * @return A new <code>ASContentModel</code> object.
  207. * @exception DOMASException
  208. * A DOMASException, e.g., <code>minOccurs > maxOccurs</code>.
  209. */
  210. public ASContentModel createASContentModel(int minOccurs,
  211. int maxOccurs,
  212. short operator)
  213. throws DOMASException;
  214. }