public interface UserDataHandler
Node.setUserData() ,应用程序可以提供一个处理程序,当对象被关联到的节点被克隆,导入或重命名时,该处理程序将被调用。
应用程序可以使用它来实现与DOM节点关联的数据的各种行为。
此接口定义该处理程序。
| Modifier and Type | Field and Description |
|---|---|
static short |
NODE_ADOPTED
采用节点,采用
Document.adoptNode() 。
|
static short |
NODE_CLONED
该节点被克隆,使用
Node.cloneNode() 。
|
static short |
NODE_DELETED
节点被删除。
|
static short |
NODE_IMPORTED
节点被导入,使用
Document.importNode() 。
|
static short |
NODE_RENAMED
节点被重命名,使用
Document.renameNode() 。
|
static final short NODE_CLONED
Node.cloneNode() 。
static final short NODE_IMPORTED
Document.importNode() 。
static final short NODE_DELETED
注意:这在某些环境中可能不受支持或可能不可靠,例如Java,其中实现对实际删除对象无实际控制。
static final short NODE_RENAMED
Document.renameNode() 。
static final short NODE_ADOPTED
Document.adoptNode() 。
void handle(short operation,
String key,
Object data,
Node src,
Node dst)
UserDataHandler 。
从处理程序中抛出异常的效果是依赖于DOM实现的。
operation - 指定在节点上执行的操作类型。
key - 指定要调用此处理程序的键。
data - 指定正在调用此处理程序的数据。
src - 指定要克隆,采用,导入或重命名的节点。
当节点被删除时,这是null 。
dst - 指定新创建的节点,如果有的话,或
null 。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.