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. /**
  14. * @deprecated
  15. * The content model of a declared element.
  16. * <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
  17. and Save Specification</a>.
  18. */
  19. public interface ASContentModel extends ASObject {
  20. /**
  21. * Signifies unbounded upper limit. The MAX_VALUE value is
  22. * <code>0xFFFFFFFF FFFFFFFF</code>. This needs to be better defined in
  23. * the generated bindings.
  24. */
  25. public static final int AS_UNBOUNDED = Integer.MAX_VALUE;
  26. // ASContentModelType
  27. /**
  28. * This constant value signifies a sequence operator. For example, in a
  29. * DTD, this would be the '<code>,</code>' operator.
  30. */
  31. public static final short AS_SEQUENCE = 0;
  32. /**
  33. * This constant value signifies a choice operator. For example, in a DTD,
  34. * this would be the '<code>|</code>' operator.
  35. */
  36. public static final short AS_CHOICE = 1;
  37. /**
  38. * All of the above.
  39. */
  40. public static final short AS_ALL = 2;
  41. /**
  42. * None of the above, i.e., neither a choice nor sequence operator.
  43. */
  44. public static final short AS_NONE = 3;
  45. /**
  46. * One of <code>AS_CHOICE</code>, <code>AS_SEQUENCE</code>,
  47. * <code>AS_ALL</code> or <code>AS_NONE</code>. The operator is applied
  48. * to all the components(ASObjects) in the <code>subModels</code>. For
  49. * example, if the list operator is <code>AS_CHOICE</code> and the
  50. * components in subModels are a, b and c then the abstract schema for
  51. * the element being declared is <code>(a|b|c)</code>.
  52. */
  53. public short getListOperator();
  54. /**
  55. * One of <code>AS_CHOICE</code>, <code>AS_SEQUENCE</code>,
  56. * <code>AS_ALL</code> or <code>AS_NONE</code>. The operator is applied
  57. * to all the components(ASObjects) in the <code>subModels</code>. For
  58. * example, if the list operator is <code>AS_CHOICE</code> and the
  59. * components in subModels are a, b and c then the abstract schema for
  60. * the element being declared is <code>(a|b|c)</code>.
  61. */
  62. public void setListOperator(short listOperator);
  63. /**
  64. * min occurrence for this content particle. Its value may be 0 or a
  65. * positive integer.
  66. */
  67. public int getMinOccurs();
  68. /**
  69. * min occurrence for this content particle. Its value may be 0 or a
  70. * positive integer.
  71. */
  72. public void setMinOccurs(int minOccurs);
  73. /**
  74. * maximum occurrence for this content particle. Its value may be
  75. * <code>0</code>, a positive integer, or <code>AS_UNBOUNDED</code> to
  76. * indicate that no upper limit has been set.
  77. */
  78. public int getMaxOccurs();
  79. /**
  80. * maximum occurrence for this content particle. Its value may be
  81. * <code>0</code>, a positive integer, or <code>AS_UNBOUNDED</code> to
  82. * indicate that no upper limit has been set.
  83. */
  84. public void setMaxOccurs(int maxOccurs);
  85. /**
  86. * Pointers to <code>ASObject</code>s such as
  87. * <code> ASElementDeclaration</code>s and further
  88. * <code>ASContentModel</code>s.
  89. */
  90. public ASObjectList getSubModels();
  91. /**
  92. * Pointers to <code>ASObject</code>s such as
  93. * <code> ASElementDeclaration</code>s and further
  94. * <code>ASContentModel</code>s.
  95. */
  96. public void setSubModels(ASObjectList subModels);
  97. /**
  98. * Removes the <code>ASObject</code> in the submodel. Nodes that already
  99. * exist in the list are moved as needed.
  100. * @param oldNode The node to be removed.
  101. */
  102. public void removesubModel(ASObject oldNode);
  103. /**
  104. * Inserts a new node in the submodel. Nodes that already exist in the
  105. * list are moved as needed.
  106. * @param newNode The new node to be inserted.
  107. * @exception DOMASException
  108. * <code>DUPLICATE_NAME_ERR</code>: Raised if a element declaration
  109. * already exists with the same name within an <code>AS_CHOICE</code>
  110. * operator.
  111. */
  112. public void insertsubModel(ASObject newNode)
  113. throws DOMASException;
  114. /**
  115. * Appends a new node to the end of the list representing the
  116. * <code>subModels</code>.
  117. * @param newNode The new node to be appended.
  118. * @return the length of the <code>subModels</code>.
  119. * @exception DOMASException
  120. * <code>DUPLICATE_NAME_ERR</code>: Raised if a element declaration
  121. * already exists with the same name within an <code>AS_CHOICE</code>
  122. * operator.
  123. * <br> <code>TYPE_ERR</code>: Raised if type is neither an
  124. * <code>ASContentModel</code> nor an <code>ASElementDeclaration</code>
  125. * .
  126. */
  127. public int appendsubModel(ASObject newNode)
  128. throws DOMASException;
  129. }