2
* Copyright (c) 2003 World Wide Web Consortium,
4
* (Massachusetts Institute of Technology, European Research Consortium for
5
* Informatics and Mathematics, Keio University). All Rights Reserved. This
6
* work is distributed under the W3C(r) Software License [1] in the hope that
7
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
8
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
* [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
16
* When associating an object to a key on a node using
17
* <code>Node.setUserData()</code> the application can provide a handler
18
* that gets called when the node the object is associated to is being
19
* cloned, imported, or renamed. This can be used by the application to
20
* implement various behaviors regarding the data it associates to the DOM
21
* nodes. This interface defines that handler.
22
* <p>See also the <a href='http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107'>Document Object Model (DOM) Level 3 Core Specification</a>.
25
public interface UserDataHandler {
28
* The node is cloned, using <code>Node.cloneNode()</code>.
30
public static final short NODE_CLONED = 1;
32
* The node is imported, using <code>Node.importNode()</code>.
34
public static final short NODE_IMPORTED = 2;
36
* The node is deleted.
37
* <p ><b>Note:</b> This may not be supported or may not be reliable in
38
* certain environments, such as Java, where the implementation has no
39
* real control over when objects are actually deleted.
41
public static final short NODE_DELETED = 3;
43
* The node is renamed, using <code>Node.renameNode()</code>.
45
public static final short NODE_RENAMED = 4;
47
* The node is adopted, using <code>Node.adoptNode()</code>.
49
public static final short NODE_ADOPTED = 5;
52
* This method is called whenever the node for which this handler is
53
* registered is imported or cloned.
54
* <br> Any exceptions thrown inside a <code>UserDataHandler</code> will
56
* @param operation Specifies the type of operation that is being
57
* performed on the node.
58
* @param key Specifies the key for which this handler is being called.
59
* @param data Specifies the data for which this handler is being called.
60
* @param src Specifies the node being cloned, adopted, imported, or
61
* renamed. This is <code>null</code> when the node is being deleted.
62
* @param dst Specifies the node newly created if any, or
65
public void handle(short operation,