001: /*
002: * Copyright (c) 2001 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE.
010: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011: */
012:
013: package org.apache.xerces.dom3.as;
014:
015: import org.w3c.dom.Node;
016:
017: /**
018: * @deprecated
019: * This interface extends a <code>Node</code> from with additional methods
020: * for guided document editing. The expectation is that an instance of the
021: * <code>DOMImplementationAS</code> interface can be obtained by using
022: * binding-specific casting methods on an instance of the
023: * <code>DOMImplementation</code> interface when the DOM implementation
024: * supports the feature "<code>AS-DOC</code>".
025: * <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
026: and Save Specification</a>.
027: */
028: public interface NodeEditAS {
029: // ASCheckType
030: /**
031: * Check for well-formedness of this node.
032: */
033: public static final short WF_CHECK = 1;
034: /**
035: * Check for namespace well-formedness includes <code>WF_CHECK</code>.
036: */
037: public static final short NS_WF_CHECK = 2;
038: /**
039: * Checks for whether this node is partially valid. It includes
040: * <code>NS_WF_CHECK</code>.
041: */
042: public static final short PARTIAL_VALIDITY_CHECK = 3;
043: /**
044: * Checks for strict validity of the node with respect to active AS which
045: * by definition includes <code>NS_WF_CHECK</code>.
046: */
047: public static final short STRICT_VALIDITY_CHECK = 4;
048:
049: /**
050: * Determines whether the <code>insertBefore</code> operation from the
051: * <code>Node</code> interface would make this document invalid with
052: * respect to the currently active AS. Describe "valid" when referring
053: * to partially completed documents.
054: * @param newChild <code>Node</code> to be inserted.
055: * @param refChild Reference <code>Node</code>.
056: * @return <code>true</code> if no reason it can't be done;
057: * <code>false</code> if it can't be done.
058: */
059: public boolean canInsertBefore(Node newChild, Node refChild);
060:
061: /**
062: * Has the same arguments as <code>RemoveChild</code>.
063: * @param oldChild <code>Node</code> to be removed.
064: * @return <code>true</code> if no reason it can't be done;
065: * <code>false</code> if it can't be done.
066: */
067: public boolean canRemoveChild(Node oldChild);
068:
069: /**
070: * Has the same arguments as <code>ReplaceChild</code>.
071: * @param newChild New <code>Node</code>.
072: * @param oldChild <code>Node</code> to be replaced.
073: * @return <code>true</code> if no reason it can't be done;
074: * <code>false</code> if it can't be done.
075: */
076: public boolean canReplaceChild(Node newChild, Node oldChild);
077:
078: /**
079: * Has the same arguments as <code>AppendChild</code>.
080: * @param newChild <code>Node</code> to be appended.
081: * @return <code>true</code> if no reason it can't be done;
082: * <code>false</code> if it can't be done.
083: */
084: public boolean canAppendChild(Node newChild);
085:
086: /**
087: * Determines if the Node is valid relative to currently active AS. It
088: * doesn't normalize before checking if the document is valid. To do so,
089: * one would need to explicitly call a normalize method.
090: * @param deep Setting the <code>deep</code> flag on causes the
091: * <code>isNodeValid</code> method to check for the whole subtree of
092: * the current node for validity. Setting it to <code>false</code>
093: * only checks the current node and its immediate child nodes. The
094: * <code>validate</code> method on the <code>DocumentAS</code>
095: * interface, however, checks to determine whether the entire document
096: * is valid.
097: * @param wFValidityCheckLevel Flag to tell at what level validity and
098: * well-formedness checking is done.
099: * @return <code>true</code> if the node is valid/well-formed in the
100: * current context and check level defined by
101: * <code>wfValidityCheckLevel</code>, <code>false</code> if not.
102: * @exception DOMASException
103: * <code>NO_AS_AVAILABLE</code>: Raised if the
104: * <code>DocumentEditAS</code> related to this node does not have any
105: * active <code>ASModel</code> and <code>wfValidityCheckLevel</code>
106: * is set to <code>PARTIAL</code> or <code>STRICT_VALIDITY_CHECK</code>
107: * .
108: */
109: public boolean isNodeValid(boolean deep, short wFValidityCheckLevel)
110: throws DOMASException;
111:
112: }
|