01: /*
02: * Copyright (c) 2002 World Wide Web Consortium,
03: * (Massachusetts Institute of Technology, Institut National de
04: * Recherche en Informatique et en Automatique, Keio University). All
05: * Rights Reserved. This program is distributed under the W3C's Software
06: * Intellectual Property License. This program is distributed in the
07: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
08: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
09: * PURPOSE.
10: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11: */
12:
13: package org.w3c.dom;
14:
15: /**
16: * When associating an object to a key on a node using <code>setUserData</code>
17: * the application can provide a handler that gets called when the node the
18: * object is associated to is being cloned or imported. This can be used by
19: * the application to implement various behaviors regarding the data it
20: * associates to the DOM nodes. This interface defines that handler.
21: * <p>See also the <a href='http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20020114'>Document Object Model (DOM) Level 3 Core Specification</a>.
22: */
23: public interface UserDataHandler {
24: // OperationType
25: /**
26: * The node is cloned.
27: */
28: public static final short NODE_CLONED = 1;
29: /**
30: * The node is imported.
31: */
32: public static final short NODE_IMPORTED = 2;
33: /**
34: * The node is deleted.
35: */
36: public static final short NODE_DELETED = 3;
37: /**
38: * The node is renamed.
39: */
40: public static final short NODE_RENAMED = 4;
41:
42: /**
43: * This method is called whenever the node for which this handler is
44: * registered is imported or cloned.
45: * @param operation Specifies the type of operation that is being
46: * performed on the node.
47: * @param key Specifies the key for which this handler is being called.
48: * @param data Specifies the data for which this handler is being called.
49: * @param src Specifies the node being cloned, imported, or renamed. This
50: * is <code>null</code> when the node is being deleted.
51: * @param dst Specifies the node newly created if any, or
52: * <code>null</code>.
53: */
54: public void handle(short operation, String key, Object data,
55: Node src, Node dst);
56:
57: }
|