KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > dom3 > as > NodeEditAS


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
13 package com.sun.org.apache.xerces.internal.dom3.as;
14
15 import org.w3c.dom.Node JavaDoc;
16
17 /**
18  * @deprecated
19  * This interface extends a <code>Node</code> from with additional methods
20  * for guided document editing. The expectation is that an instance of the
21  * <code>DOMImplementationAS</code> interface can be obtained by using
22  * binding-specific casting methods on an instance of the
23  * <code>DOMImplementation</code> interface when the DOM implementation
24  * supports the feature "<code>AS-DOC</code>".
25  * <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
26 and Save Specification</a>.
27  */

28 public interface NodeEditAS {
29     // ASCheckType
30
/**
31      * Check for well-formedness of this node.
32      */

33     public static final short WF_CHECK = 1;
34     /**
35      * Check for namespace well-formedness includes <code>WF_CHECK</code>.
36      */

37     public static final short NS_WF_CHECK = 2;
38     /**
39      * Checks for whether this node is partially valid. It includes
40      * <code>NS_WF_CHECK</code>.
41      */

42     public static final short PARTIAL_VALIDITY_CHECK = 3;
43     /**
44      * Checks for strict validity of the node with respect to active AS which
45      * by definition includes <code>NS_WF_CHECK</code>.
46      */

47     public static final short STRICT_VALIDITY_CHECK = 4;
48
49     /**
50      * Determines whether the <code>insertBefore</code> operation from the
51      * <code>Node</code> interface would make this document invalid with
52      * respect to the currently active AS. Describe "valid" when referring
53      * to partially completed documents.
54      * @param newChild <code>Node</code> to be inserted.
55      * @param refChild Reference <code>Node</code>.
56      * @return <code>true</code> if no reason it can't be done;
57      * <code>false</code> if it can't be done.
58      */

59     public boolean canInsertBefore(Node JavaDoc newChild,
60                                    Node JavaDoc refChild);
61
62     /**
63      * Has the same arguments as <code>RemoveChild</code>.
64      * @param oldChild <code>Node</code> to be removed.
65      * @return <code>true</code> if no reason it can't be done;
66      * <code>false</code> if it can't be done.
67      */

68     public boolean canRemoveChild(Node JavaDoc oldChild);
69
70     /**
71      * Has the same arguments as <code>ReplaceChild</code>.
72      * @param newChild New <code>Node</code>.
73      * @param oldChild <code>Node</code> to be replaced.
74      * @return <code>true</code> if no reason it can't be done;
75      * <code>false</code> if it can't be done.
76      */

77     public boolean canReplaceChild(Node JavaDoc newChild,
78                                    Node JavaDoc oldChild);
79
80     /**
81      * Has the same arguments as <code>AppendChild</code>.
82      * @param newChild <code>Node</code> to be appended.
83      * @return <code>true</code> if no reason it can't be done;
84      * <code>false</code> if it can't be done.
85      */

86     public boolean canAppendChild(Node JavaDoc newChild);
87
88     /**
89      * Determines if the Node is valid relative to currently active AS. It
90      * doesn't normalize before checking if the document is valid. To do so,
91      * one would need to explicitly call a normalize method.
92      * @param deep Setting the <code>deep</code> flag on causes the
93      * <code>isNodeValid</code> method to check for the whole subtree of
94      * the current node for validity. Setting it to <code>false</code>
95      * only checks the current node and its immediate child nodes. The
96      * <code>validate</code> method on the <code>DocumentAS</code>
97      * interface, however, checks to determine whether the entire document
98      * is valid.
99      * @param wFValidityCheckLevel Flag to tell at what level validity and
100      * well-formedness checking is done.
101      * @return <code>true</code> if the node is valid/well-formed in the
102      * current context and check level defined by
103      * <code>wfValidityCheckLevel</code>, <code>false</code> if not.
104      * @exception DOMASException
105      * <code>NO_AS_AVAILABLE</code>: Raised if the
106      * <code>DocumentEditAS</code> related to this node does not have any
107      * active <code>ASModel</code> and <code>wfValidityCheckLevel</code>
108      * is set to <code>PARTIAL</code> or <code>STRICT_VALIDITY_CHECK</code>
109      * .
110      */

111     public boolean isNodeValid(boolean deep,
112                                short wFValidityCheckLevel)
113                                throws DOMASException;
114
115 }
116
Popular Tags