XML technologies / XML / XML in a Nutshell / DOM reference / Object reference / UserDataHandler
(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)
The method Node.setUserData( ) allows the programmer to register a callback object notified when various operations are performed on the node in question. These callback objects must implement this interface to receive the notifications.
Attributes
The interface UserDataHandler has no attributes.
Method
The following method is defined for this interface:
handle: operation, key, data, src, dst (3)
This method is called when the Node object associated with the parent object derived from UserDataHandler is imported or cloned. This method must be implemented by users of DOM who want notification when monitored Node objects are manipulated.
Note: When implementing the handle( ) method, make sure to catch any exceptions so that they do not propagate into the calling DOM code. Internal DOM behavior is undefined if this method throws an exception.
Arguments
operation: unsigned short
The kind of
operationthat occurred. It is based on the following values:
| | |
| | |
| | |
| | |
| | |
| | |
The user-defined key from the
Node.setUserData( )method for which thehandle( )method is called.data: DOMUserData
The user data corresponding to the
keyargument and originally set using the methodNode.setUserData( ).src: Node
The node being cloned, adopted, imported or renamed. This argument is
null, when the node is deleted.dst: Node
The newly cloned or imported node, or
null, if no new node was created.
Java binding
public boolean isDerivedFrom(String typeNamespaceArg,
String typeNameArg, int derivationMethod);
Copyright © 2005 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "XML in a Nutshell" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de