Packagedom.core
Classpublic class UserDataHandler
InheritanceUserDataHandler Inheritance Object

Introduced in: DOM 3 Core 

When associating user data with a key on a node, Node.setUserData() can also accept, in its third argument, a handler which will be called when the object is cloned, imported, deleted, renamed, or adopted. Per the specification, exceptions should not be thrown in a UserDataHandler. In both document.importNode() and Node.cloneNode(), although user data is not copied over, the handler will be called.

See also

MDC - UserDataHandler
W3C - UserDataHandler


Public Methods
 MethodDefined By
  
DOM 3 Core handle(operation:Number, key:DOMString, data:Object, src:Node, dst:Node):void
This method is called whenever the node for which this handler is registered is imported or cloned.
UserDataHandler
Public Constants
 ConstantDefined By
  DOM 3 Core NODE_ADOPTED : Number = 5
[static] The node is adopted, using Document.adoptNode().
UserDataHandler
  DOM 3 Core NODE_CLONED : Number = 1
[static] The node is cloned, using Node.cloneNode().
UserDataHandler
  DOM 3 Core NODE_DELETED : Number = 3
[static] The node is deleted.
UserDataHandler
  DOM 3 Core NODE_IMPORTED : Number = 2
[static] The node is imported, using Document.importNode().
UserDataHandler
  DOM 3 Core NODE_RENAMED : Number = 4
[static] The node is renamed, using Document.renameNode().
UserDataHandler
Method Detail
DOM 3 Core handle()method
public function handle(operation:Number, key:DOMString, data:Object, src:Node, dst:Node):void

Introduced in: DOM 3 Core 

This method is called whenever the node for which this handler is registered is imported or cloned.

Parameters

operation:Number — Specifies the type of operation that is being performed on the node.
 
key:DOMString — Specifies the key for which this handler is being called.
 
data:Object — Specifies the data for which this handler is being called.
 
src:Node — Specifies the node being cloned, adopted, imported, or renamed. This is null when the node is being deleted.
 
dst:Node — Specifies the node newly created if any, or null.

See also

Constant Detail
DOM 3 Core NODE_ADOPTEDConstant
public static const NODE_ADOPTED:Number = 5

Introduced in: DOM 3 Core 

The node is adopted, using Document.adoptNode().

DOM 3 Core NODE_CLONEDConstant 
public static const NODE_CLONED:Number = 1

Introduced in: DOM 3 Core 

The node is cloned, using Node.cloneNode().

DOM 3 Core NODE_DELETEDConstant 
public static const NODE_DELETED:Number = 3

Introduced in: DOM 3 Core 

The node is deleted.

DOM 3 Core NODE_IMPORTEDConstant 
public static const NODE_IMPORTED:Number = 2

Introduced in: DOM 3 Core 

The node is imported, using Document.importNode().

DOM 3 Core NODE_RENAMEDConstant 
public static const NODE_RENAMED:Number = 4

Introduced in: DOM 3 Core 

The node is renamed, using Document.renameNode().