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. /**
  15. * @deprecated
  16. * This interface extends a <code>Node</code> from with additional methods
  17. * for guided document editing. The expectation is that an instance of the
  18. * <code>DOMImplementationAS</code> interface can be obtained by using
  19. * binding-specific casting methods on an instance of the
  20. * <code>DOMImplementation</code> interface when the DOM implementation
  21. * supports the feature "<code>AS-DOC</code>".
  22. * <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
  23. and Save Specification</a>.
  24. */
  25. public interface NodeEditAS {
  26. // ASCheckType
  27. /**
  28. * Check for well-formedness of this node.
  29. */
  30. public static final short WF_CHECK = 1;
  31. /**
  32. * Check for namespace well-formedness includes <code>WF_CHECK</code>.
  33. */
  34. public static final short NS_WF_CHECK = 2;
  35. /**
  36. * Checks for whether this node is partially valid. It includes
  37. * <code>NS_WF_CHECK</code>.
  38. */
  39. public static final short PARTIAL_VALIDITY_CHECK = 3;
  40. /**
  41. * Checks for strict validity of the node with respect to active AS which
  42. * by definition includes <code>NS_WF_CHECK</code>.
  43. */
  44. public static final short STRICT_VALIDITY_CHECK = 4;
  45. /**
  46. * Determines whether the <code>insertBefore</code> operation from the
  47. * <code>Node</code> interface would make this document invalid with
  48. * respect to the currently active AS. Describe "valid" when referring
  49. * to partially completed documents.
  50. * @param newChild <code>Node</code> to be inserted.
  51. * @param refChild Reference <code>Node</code>.
  52. * @return <code>true</code> if no reason it can't be done;
  53. * <code>false</code> if it can't be done.
  54. */
  55. public boolean canInsertBefore(Node newChild,
  56. Node refChild);
  57. /**
  58. * Has the same arguments as <code>RemoveChild</code>.
  59. * @param oldChild <code>Node</code> to be removed.
  60. * @return <code>true</code> if no reason it can't be done;
  61. * <code>false</code> if it can't be done.
  62. */
  63. public boolean canRemoveChild(Node oldChild);
  64. /**
  65. * Has the same arguments as <code>ReplaceChild</code>.
  66. * @param newChild New <code>Node</code>.
  67. * @param oldChild <code>Node</code> to be replaced.
  68. * @return <code>true</code> if no reason it can't be done;
  69. * <code>false</code> if it can't be done.
  70. */
  71. public boolean canReplaceChild(Node newChild,
  72. Node oldChild);
  73. /**
  74. * Has the same arguments as <code>AppendChild</code>.
  75. * @param newChild <code>Node</code> to be appended.
  76. * @return <code>true</code> if no reason it can't be done;
  77. * <code>false</code> if it can't be done.
  78. */
  79. public boolean canAppendChild(Node newChild);
  80. /**
  81. * Determines if the Node is valid relative to currently active AS. It
  82. * doesn't normalize before checking if the document is valid. To do so,
  83. * one would need to explicitly call a normalize method.
  84. * @param deep Setting the <code>deep</code> flag on causes the
  85. * <code>isNodeValid</code> method to check for the whole subtree of
  86. * the current node for validity. Setting it to <code>false</code>
  87. * only checks the current node and its immediate child nodes. The
  88. * <code>validate</code> method on the <code>DocumentAS</code>
  89. * interface, however, checks to determine whether the entire document
  90. * is valid.
  91. * @param wFValidityCheckLevel Flag to tell at what level validity and
  92. * well-formedness checking is done.
  93. * @return <code>true</code> if the node is valid/well-formed in the
  94. * current context and check level defined by
  95. * <code>wfValidityCheckLevel</code>, <code>false</code> if not.
  96. * @exception DOMASException
  97. * <code>NO_AS_AVAILABLE</code>: Raised if the
  98. * <code>DocumentEditAS</code> related to this node does not have any
  99. * active <code>ASModel</code> and <code>wfValidityCheckLevel</code>
  100. * is set to <code>PARTIAL</code> or <code>STRICT_VALIDITY_CHECK</code>
  101. * .
  102. */
  103. public boolean isNodeValid(boolean deep,
  104. short wFValidityCheckLevel)
  105. throws DOMASException;
  106. }