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.Node;
  14. import org.w3c.dom.NodeList;
  15. import org.w3c.dom.Attr;
  16. /**
  17. * @deprecated
  18. * This interface extends the <code>Element</code> interface with additional
  19. * methods for guided document editing. An object implementing this
  20. * interface must also implement NodeEditAS interface.
  21. * <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
  22. and Save Specification</a>.
  23. */
  24. public interface ElementEditAS extends NodeEditAS {
  25. /**
  26. * The list of qualified element names defined in the abstract schema.
  27. */
  28. public NodeList getDefinedElementTypes();
  29. /**
  30. * Determines element content type.
  31. * @return Constant for one of EMPTY_CONTENTTYPE, ANY_CONTENTTYPE,
  32. * MIXED_CONTENTTYPE, ELEMENTS_CONTENTTYPE.
  33. */
  34. public short contentType();
  35. /**
  36. * Determines if the value for specified attribute can be set.
  37. * @param attrname Name of attribute.
  38. * @param attrval Value to be assigned to the attribute.
  39. * @return <code>true</code> if no reason it can't be done;
  40. * <code>false</code> if it can't be done.
  41. */
  42. public boolean canSetAttribute(String attrname,
  43. String attrval);
  44. /**
  45. * Determines if an attribute node can be added with respect to the
  46. * validity check level.This is an attribute node, there is no need for
  47. * canSetAttributreNodeNS!
  48. * @param attrNode <code>Node</code> in which the attribute can possibly
  49. * be set.
  50. * @return <code>true</code> if no reason it can't be done;
  51. * <code>false</code> if it can't be done.
  52. */
  53. public boolean canSetAttributeNode(Attr attrNode);
  54. /**
  55. * Determines if the attribute with given namespace and qualified name can
  56. * be created if not already present in the attribute list of the
  57. * element. If the attribute with same qualified name and namespaceURI
  58. * is already present in the elements attribute list it tests for the
  59. * value of the attribute and its prefix to the new value. See DOM core
  60. * <code>setAttributeNS</code>.
  61. * @param name Qualified name of attribute.
  62. * @param attrval Value to be assigned to the attribute.
  63. * @param namespaceURI <code>namespaceURI</code> of namespace.
  64. * @return <code>true</code> if no reason it can't be done;
  65. * <code>false</code> if it can't be done.
  66. */
  67. public boolean canSetAttributeNS(String name,
  68. String attrval,
  69. String namespaceURI);
  70. /**
  71. * Verifies if an attribute by the given name can be removed.
  72. * @param attrname Name of attribute.
  73. * @return <code>true</code> if no reason it can't be done;
  74. * <code>false</code> if it can't be done.
  75. */
  76. public boolean canRemoveAttribute(String attrname);
  77. /**
  78. * Verifies if an attribute by the given local name and namespace can be
  79. * removed.
  80. * @param attrname Local name of the attribute to be removed.
  81. * @param namespaceURI The namespace URI of the attribute to remove.
  82. * @return <code>true</code> if no reason it can't be done;
  83. * <code>false</code> if it can't be done.
  84. */
  85. public boolean canRemoveAttributeNS(String attrname,
  86. String namespaceURI);
  87. /**
  88. * Determines if an attribute node can be removed.
  89. * @param attrNode The <code>Attr</code> node to remove from the
  90. * attribute list.
  91. * @return <code>true</code> if no reason it can't be done;
  92. * <code>false</code> if it can't be done.
  93. */
  94. public boolean canRemoveAttributeNode(Node attrNode);
  95. /**
  96. * Returns an <code>NodeList</code> containing the possible
  97. * <code>Element</code> names that can appear as children of this type
  98. * of element.
  99. * @return List of possible children element types of this element.
  100. */
  101. public NodeList getChildElements();
  102. /**
  103. * Returns an <code>NodeList</code> containing the possible
  104. * <code>Element</code> names that can appear as a parent of this type
  105. * of element.
  106. * @return List of possible parent element types of this element.
  107. */
  108. public NodeList getParentElements();
  109. /**
  110. * Returns an <code>NodeList</code> containing all the possible
  111. * <code>Attr</code>s that can appear with this type of element.
  112. * @return List of possible attributes of this element.
  113. */
  114. public NodeList getAttributeList();
  115. /**
  116. * Determines if this element is defined in the currently active AS.
  117. * @param elemTypeName Name of element.
  118. * @return A boolean that is <code>true</code> if the element is defined,
  119. * <code>false</code> otherwise.
  120. */
  121. public boolean isElementDefined(String elemTypeName);
  122. /**
  123. * Determines if this element in this namespace is defined in the
  124. * currently active AS.
  125. * @param elemTypeName Name of element.
  126. * @param namespaceURI <code>namespaceURI</code> of namespace.
  127. * @param name Qualified name of namespace. This is for sub-elements.
  128. * @return A boolean that is <code>true</code> if the element is defined,
  129. * <code>false</code> otherwise.
  130. */
  131. public boolean isElementDefinedNS(String elemTypeName,
  132. String namespaceURI,
  133. String name);
  134. }