Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xerces.dom.NodeImpl
public abstract class NodeImpl
extends java.lang.Object
implements org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.events.EventTarget, Cloneable, Serializable
Field Summary | |
static short | |
static short | |
static short | |
static short | |
static short | |
static short | |
static short |
|
protected static short | |
protected static short | |
protected static short | |
protected static short | |
protected static short | |
protected static short | |
protected static short | |
protected static short | |
protected static short | |
protected static short | |
static short |
|
static short |
|
static short |
|
static short |
|
static short |
|
static short |
|
static short |
|
protected short | |
protected NodeImpl |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
org.w3c.dom.Node |
|
protected void |
|
protected int |
|
org.w3c.dom.Node |
|
short |
|
short |
|
boolean |
|
org.w3c.dom.NamedNodeMap |
|
String |
|
org.w3c.dom.NodeList |
|
protected org.w3c.dom.Node |
|
Object |
|
org.w3c.dom.Node |
|
org.w3c.dom.Node |
|
int |
|
String |
|
String |
|
org.w3c.dom.Node |
|
abstract String |
|
protected int |
|
abstract short |
|
String |
|
org.w3c.dom.Document |
|
org.w3c.dom.Node |
|
String |
|
org.w3c.dom.Node |
|
boolean |
|
String |
|
Object |
|
Object |
|
protected Hashtable | |
boolean |
|
boolean |
|
org.w3c.dom.Node |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
org.w3c.dom.Node |
|
String |
|
String |
|
void |
|
void |
|
org.w3c.dom.Node |
|
void |
|
org.w3c.dom.Node |
|
void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
Object |
|
protected void |
|
String |
|
public static final short DOCUMENT_POSITION_CONTAINS
- Field Value:
- 8
public static final short DOCUMENT_POSITION_DISCONNECTED
- Field Value:
- 1
public static final short DOCUMENT_POSITION_FOLLOWING
- Field Value:
- 4
public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
- Field Value:
- 32
public static final short DOCUMENT_POSITION_IS_CONTAINED
- Field Value:
- 16
public static final short DOCUMENT_POSITION_PRECEDING
- Field Value:
- 2
public static final short ELEMENT_DEFINITION_NODE
Element definition node type.
- Field Value:
- 21
protected static final short FIRSTCHILD
- Field Value:
- 16
protected static final short HASSTRING
- Field Value:
- 128
protected static final short ID
- Field Value:
- 512
protected static final short IGNORABLEWS
- Field Value:
- 64
protected static final short NORMALIZED
- Field Value:
- 256
protected static final short OWNED
- Field Value:
- 8
protected static final short READONLY
- Field Value:
- 1
protected static final short SPECIFIED
- Field Value:
- 32
protected static final short SYNCCHILDREN
- Field Value:
- 4
protected static final short SYNCDATA
- Field Value:
- 2
public static final short TREE_POSITION_ANCESTOR
The node is an ancestor of the reference node.
- Field Value:
- 4
public static final short TREE_POSITION_DESCENDANT
The node is a descendant of the reference node.
- Field Value:
- 8
public static final short TREE_POSITION_DISCONNECTED
The two nodes are disconnected, they do not have any common ancestor. This is the case of two nodes that are not in the same document.
- Field Value:
- 0
public static final short TREE_POSITION_EQUIVALENT
The two nodes have an equivalent position. This is the case of two attributes that have the sameownerElement
, and two nodes that are the same.
- Field Value:
- 16
public static final short TREE_POSITION_FOLLOWING
The node follows the reference node.
- Field Value:
- 2
public static final short TREE_POSITION_PRECEDING
The node precedes the reference node.
- Field Value:
- 1
public static final short TREE_POSITION_SAME_NODE
The two nodes are the same. Two nodes that are the same have an equivalent position, though the reverse may not be true.
- Field Value:
- 32
protected short flags
public NodeImpl()
Constructor for serialization.
protected NodeImpl(CoreDocumentImpl ownerDocument)
No public constructor; only subclasses of Node should be instantiated, and those normally via a Document's factory methods Every Node knows what Document it belongs to.
public void addEventListener(String type, org.w3c.dom.events.EventListener listener, boolean useCapture)
- Specified by:
- addEventListener in interface org.w3c.dom.events.EventTarget
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
Adds a child node to the end of the list of children for this node. Convenience shorthand for insertBefore(newChild,null).
- Specified by:
- appendChild in interface org.w3c.dom.Node
- Returns:
- newChild, in its new state (relocated, or emptied in the case of DocumentNode.)
protected void changed()
Denotes that this node has changed.
protected int changes()
Returns the number of changes to this node.
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other. Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior.
- Specified by:
- cloneNode in interface org.w3c.dom.Node
public short compareDocumentPosition(org.w3c.dom.Node other) throws org.w3c.dom.DOMException
Compares a node with this node with regard to their position in the document.
- Specified by:
- compareDocumentPosition in interface org.w3c.dom.Node
- Parameters:
other
- The node to compare against this node.
- Returns:
- Returns how the given node is positioned relatively to this node.
- Since:
- DOM Level 3
public short compareTreePosition(org.w3c.dom.Node other)
Deprecated.
Compares a node with this node with regard to their position in the tree and according to the document order. This order can be extended by module that define additional types of nodes.
- Parameters:
other
- The node to compare against this node.
- Returns:
- Returns how the given node is positioned relatively to this node.
- Since:
- DOM Level 3
public boolean dispatchEvent(org.w3c.dom.events.Event event)
- Specified by:
- dispatchEvent in interface org.w3c.dom.events.EventTarget
public org.w3c.dom.NamedNodeMap getAttributes()
Return the collection of attributes associated with this node, or null if none. At this writing, Element is the only type of node which will ever have attributes.
- Specified by:
- getAttributes in interface org.w3c.dom.Node
- See Also:
ElementImpl
public String getBaseURI()
The absolute base URI of this node ornull
if undefined. This value is computed according to . However, when theDocument
supports the feature "HTML" , the base URI is computed using first the value of the href attribute of the HTML BASE element if any, and the value of thedocumentURI
attribute from theDocument
interface otherwise.
When the node is anElement
, aDocument
or a aProcessingInstruction
, this attribute represents the properties [base URI] defined in . When the node is aNotation
, anEntity
, or anEntityReference
, this attribute represents the properties [declaration base URI] in the . How will this be affected by resolution of relative namespace URIs issue?It's not.Should this only be on Document, Element, ProcessingInstruction, Entity, and Notation nodes, according to the infoset? If not, what is it equal to on other nodes? Null? An empty string? I think it should be the parent's.No.Should this be read-only and computed or and actual read-write attribute?Read-only and computed (F2F 19 Jun 2000 and teleconference 30 May 2001).If the base HTML element is not yet attached to a document, does the insert change the Document.baseURI? Yes. (F2F 26 Sep 2001)
- Specified by:
- getBaseURI in interface org.w3c.dom.Node
- Since:
- DOM Level 3
public org.w3c.dom.NodeList getChildNodes()
Obtain a NodeList enumerating all children of this node. If there are none, an (initially) empty NodeList is returned. NodeLists are "live"; as children are added/removed the NodeList will immediately reflect those changes. Also, the NodeList refers to the actual nodes, so changes to those nodes made via the DOM tree will be reflected in the NodeList and vice versa. In this implementation, Nodes implement the NodeList interface and provide their own getChildNodes() support. Other DOMs may solve this differently.
- Specified by:
- getChildNodes in interface org.w3c.dom.Node
protected org.w3c.dom.Node getContainer()
For non-child nodes, the node which "points" to this node. For example, the owning element for an attribute
public Object getFeature(String feature, String version)
- Specified by:
- getFeature in interface org.w3c.dom.Node
- Since:
- DOM Level 3
public org.w3c.dom.Node getFirstChild()
The first child of this Node, or null if none. By default we do not have any children, ParentNode overrides this.
- Specified by:
- getFirstChild in interface org.w3c.dom.Node
- See Also:
ParentNode
public org.w3c.dom.Node getLastChild()
The first child of this Node, or null if none. By default we do not have any children, ParentNode overrides this.
- Specified by:
- getLastChild in interface org.w3c.dom.Node
- See Also:
ParentNode
public int getLength()
NodeList method: Count the immediate children of this node By default we do not have any children, ParentNode overrides this.
- Specified by:
- getLength in interface org.w3c.dom.NodeList
- Returns:
- int
- See Also:
ParentNode
public String getLocalName()
Introduced in DOM Level 2. Returns the local part of the qualified name of this node. For nodes created with a DOM Level 1 method, such as createElement from the Document interface, and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this is the same as the nodeName attribute.
- Specified by:
- getLocalName in interface org.w3c.dom.Node
- Since:
- WD-DOM-Level-2-19990923
- See Also:
AttrNSImpl
,ElementNSImpl
public String getNamespaceURI()
Introduced in DOM Level 2. The namespace URI of this node, or null if it is unspecified. When this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE, this is always null and setting it has no effect. This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time. For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.
- Specified by:
- getNamespaceURI in interface org.w3c.dom.Node
- Since:
- WD-DOM-Level-2-19990923
- See Also:
AttrNSImpl
,ElementNSImpl
public org.w3c.dom.Node getNextSibling()
The next child of this node's parent, or null if none
- Specified by:
- getNextSibling in interface org.w3c.dom.Node
public abstract String getNodeName()
the name of this node.
- Specified by:
- getNodeName in interface org.w3c.dom.Node
protected int getNodeNumber()
Returns the node number
public abstract short getNodeType()
A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface.
- Specified by:
- getNodeType in interface org.w3c.dom.Node
public String getNodeValue() throws org.w3c.dom.DOMException
Returns the node value.
- Specified by:
- getNodeValue in interface org.w3c.dom.Node
public org.w3c.dom.Document getOwnerDocument()
Find the Document that this Node belongs to (the document in whose context the Node was created). The Node may or may not currently be part of that Document's actual contents.
- Specified by:
- getOwnerDocument in interface org.w3c.dom.Node
public org.w3c.dom.Node getParentNode()
Obtain the DOM-tree parent of this node, or null if it is not currently active in the DOM tree (perhaps because it has just been created or removed). Note that Document, DocumentFragment, and Attribute will never have parents.
- Specified by:
- getParentNode in interface org.w3c.dom.Node
public String getPrefix()
Introduced in DOM Level 2. The namespace prefix of this node, or null if it is unspecified. When this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this is always null and setting it has no effect. For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.
- Specified by:
- getPrefix in interface org.w3c.dom.Node
- Since:
- WD-DOM-Level-2-19990923
- See Also:
AttrNSImpl
,ElementNSImpl
public org.w3c.dom.Node getPreviousSibling()
The previous child of this node's parent, or null if none
- Specified by:
- getPreviousSibling in interface org.w3c.dom.Node
public boolean getReadOnly()
NON-DOM: Returns true if this node is read-only. This is a shallow check.
public String getTextContent() throws org.w3c.dom.DOMException
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. When set, any possible children this node may have are removed and replaced by a singleText
node containing the string this attribute is set to. On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed, the returned string does not contain the element content whitespaces . Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
The string returned is made of the text content of this node depending on its type, as defined below:
Node type Content Text
Node type Content ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent
attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodesATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null
- Specified by:
- getTextContent in interface org.w3c.dom.Node
- Throws:
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.org.w3c.dom.DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in aDOMString
variable on the implementation platform.
- Since:
- DOM Level 3
public Object getUserData()
NON-DOM: Returns the user data associated to this node.
public Object getUserData(String key)
Retrieves the object associated to a key on a this node. The object must first have been set to this node by callingsetUserData
with the same key.
- Specified by:
- getUserData in interface org.w3c.dom.Node
- Parameters:
key
- The key the object is associated to.
- Returns:
- Returns the
DOMObject
associated to the given key on this node, ornull
if there was none.
- Since:
- DOM Level 3
protected Hashtable getUserDataRecord()
public boolean hasAttributes()
Returns whether this node (if it is an element) has any attributes.
- Specified by:
- hasAttributes in interface org.w3c.dom.Node
- Returns:
true
if this node has any attributes,false
otherwise.
- Since:
- DOM Level 2
- See Also:
ElementImpl
public boolean hasChildNodes()
Test whether this node has any children. Convenience shorthand for (Node.getFirstChild()!=null) By default we do not have any children, ParentNode overrides this.
- Specified by:
- hasChildNodes in interface org.w3c.dom.Node
- See Also:
ParentNode
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
Move one or more node(s) to our list of children. Note that this implicitly removes them from their previous parent. By default we do not accept any children, ParentNode overrides this.
- Specified by:
- insertBefore in interface org.w3c.dom.Node
- Parameters:
newChild
- The Node to be moved to our subtree. As a convenience feature, inserting a DocumentNode will instead insert all its children.refChild
- Current child which newChild should be placed immediately before. If refChild is null, the insertion occurs after all existing Nodes, like appendChild().
- Returns:
- newChild, in its new state (relocated, or emptied in the case of DocumentNode.)
- See Also:
ParentNode
public boolean isDefaultNamespace(String namespaceURI)
DOM Level 3: Experimental This method checks if the specifiednamespaceURI
is the default namespace or not.
- Specified by:
- isDefaultNamespace in interface org.w3c.dom.Node
- Parameters:
namespaceURI
- The namespace URI to look for.
- Returns:
true
if the specifiednamespaceURI
is the default namespace,false
otherwise.
- Since:
- DOM Level 3
public boolean isEqualNode(org.w3c.dom.Node arg)
Tests whether two nodes are equal.
This method tests for equality of nodes, not sameness (i.e., whether the two nodes are references to the same object) which can be tested withNode.isSameNode
. All nodes that are the same will also be equal, though the reverse may not be true.
Two nodes are equal if and only if the following conditions are satisfied: The two nodes are of the same type.The following string attributes are equal:nodeName
,localName
,namespaceURI
,prefix
,nodeValue
,baseURI
. This is: they are bothnull
, or they have the same length and are character for character identical. Theattributes
NamedNodeMaps
are equal. This is: they are bothnull
, or they have the same length and for each node that exists in one map there is a node that exists in the other map and is equal, although not necessarily at the same index.ThechildNodes
NodeLists
are equal. This is: they are bothnull
, or they have the same length and contain equal nodes at the same index. This is true forAttr
nodes as for any other type of node. Note that normalization can affect equality; to avoid this, nodes should be normalized before being compared.
For twoDocumentType
nodes to be equal, the following conditions must also be satisfied: The following string attributes are equal:publicId
,systemId
,internalSubset
.Theentities
NamedNodeMaps
are equal.Thenotations
NamedNodeMaps
are equal.
On the other hand, the following do not affect equality: theownerDocument
attribute, thespecified
attribute forAttr
nodes, theisWhitespaceInElementContent
attribute forText
nodes, as well as any user data or event listeners registered on the nodes.
- Specified by:
- isEqualNode in interface org.w3c.dom.Node
- Parameters:
arg
- The node to compare equality with.
- Returns:
- If the nodes, and possibly subtrees are equal,
true
otherwisefalse
.
- Since:
- DOM Level 3
public boolean isSameNode(org.w3c.dom.Node other)
Returns whether this node is the same node as the given one.
This method provides a way to determine whether twoNode
references returned by the implementation reference the same object. When twoNode
references are references to the same object, even if through a proxy, the references may be used completely interchangably, such that all attributes have the same values and calling the same DOM method on either reference always has exactly the same effect.
- Specified by:
- isSameNode in interface org.w3c.dom.Node
- Parameters:
other
- The node to test against.
- Returns:
- Returns
true
if the nodes are the same,false
otherwise.
- Since:
- DOM Level 3
public boolean isSupported(String feature, String version)
Introduced in DOM Level 2. Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
- Specified by:
- isSupported in interface org.w3c.dom.Node
- Parameters:
feature
- The package name of the feature to test. This is the same name as what can be passed to the method hasFeature on DOMImplementation.version
- This is the version number of the package name to test. In Level 2, version 1, this is the string "2.0". If the version is not specified, supporting any version of the feature will cause the method to return true.
- Returns:
- boolean Returns true if this node defines a subtree within which the specified feature is supported, false otherwise.
- Since:
- WD-DOM-Level-2-19990923
public org.w3c.dom.Node item(int index)
NodeList method: Return the Nth immediate child of this node, or null if the index is out of bounds. By default we do not have any children, ParentNode overrides this.
- Specified by:
- item in interface org.w3c.dom.NodeList
- Parameters:
- Returns:
- org.w3c.dom.Node
- See Also:
ParentNode
public String lookupNamespaceURI(String specifiedPrefix)
DOM Level 3 - Experimental: Look up the namespace URI associated to the given prefix, starting from this node. Use lookupNamespaceURI(null) to lookup the default namespace
- Specified by:
- lookupNamespaceURI in interface org.w3c.dom.Node
- Parameters:
- Returns:
- th URI for the namespace
- Since:
- DOM Level 3
public String lookupPrefix(String namespaceURI)
DOM Level 3 - Experimental: Look up the prefix associated to the given namespace URI, starting from this node.
- Specified by:
- lookupPrefix in interface org.w3c.dom.Node
- Parameters:
namespaceURI
-
- Returns:
- the prefix for the namespace
public final void needsSyncChildren(boolean value)
public void normalize()
Puts allText
nodes in the full depth of the sub-tree underneath thisNode
, including attribute nodes, into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separatesText
nodes, i.e., there are no adjacentText
nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.In cases where the document containsCDATASections
, the normalize operation alone may not be sufficient, since XPointers do not differentiate betweenText
nodes andCDATASection
nodes. Note that this implementation simply calls normalize() on this Node's children. It is up to implementors or Node to override normalize() to take action.
- Specified by:
- normalize in interface org.w3c.dom.Node
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
Remove a child from this Node. The removed child's subtree remains intact so it may be re-inserted elsewhere. By default we do not have any children, ParentNode overrides this.
- Specified by:
- removeChild in interface org.w3c.dom.Node
- Returns:
- oldChild, in its new state (removed).
- See Also:
ParentNode
public void removeEventListener(String type, org.w3c.dom.events.EventListener listener, boolean useCapture)
- Specified by:
- removeEventListener in interface org.w3c.dom.events.EventTarget
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
Make newChild occupy the location that oldChild used to have. Note that newChild will first be removed from its previous parent, if any. Equivalent to inserting newChild before oldChild, then removing oldChild. By default we do not have any children, ParentNode overrides this.
- Specified by:
- replaceChild in interface org.w3c.dom.Node
- Returns:
- oldChild, in its new state (removed).
- See Also:
ParentNode
public void setNodeValue(String x) throws org.w3c.dom.DOMException
Sets the node value.
- Specified by:
- setNodeValue in interface org.w3c.dom.Node
protected void setOwnerDocument(CoreDocumentImpl doc)
NON-DOM set the ownerDocument of this node
public void setPrefix(String prefix) throws org.w3c.dom.DOMException
Introduced in DOM Level 2. The namespace prefix of this node, or null if it is unspecified. When this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this is always null and setting it has no effect. For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null. Note that setting this attribute changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
- Specified by:
- setPrefix in interface org.w3c.dom.Node
- Since:
- WD-DOM-Level-2-19990923
- See Also:
AttrNSImpl
,ElementNSImpl
public void setReadOnly(boolean readOnly, boolean deep)
NON-DOM: PR-DOM-Level-1-19980818 mentions readonly nodes in conjunction with Entities, but provides no API to support this. Most DOM users should not touch this method. Its anticpated use is during construction of EntityRefernces, where it will be used to lock the contents replicated from Entity so they can't be casually altered. It _could_ be published as a DOM extension, if desired. Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior.
- Parameters:
readOnly
- True or false as desired.deep
- If true, children are also toggled. Note that this will not change the state of an EntityReference or its children, which are always read-only.
- See Also:
ParentNode
public void setTextContent(String textContent) throws org.w3c.dom.DOMException
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. When set, any possible children this node may have are removed and replaced by a singleText
node containing the string this attribute is set to. On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed, the returned string does not contain the element content whitespaces . Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
The string returned is made of the text content of this node depending on its type, as defined below:
Node type Content ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent
attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodesATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null
- Specified by:
- setTextContent in interface org.w3c.dom.Node
- Throws:
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.org.w3c.dom.DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in aDOMString
variable on the implementation platform.
- Since:
- DOM Level 3
public void setUserData(Object data)
NON-DOM: As an alternative to subclassing the DOM, this implementation has been extended with the ability to attach an object to each node. (If you need multiple objects, you can attach a collection such as a vector or hashtable, then attach your application information to that.) Important Note: You are responsible for removing references to your data on nodes that are no longer used. Failure to do so will prevent the nodes, your data is attached to, to be garbage collected until the whole document is.
- Parameters:
data
- the object to store or null to remove any existing reference
public Object setUserData(String key, Object data, org.w3c.dom.UserDataHandler handler)
Associate an object to a key on this node. The object can later be retrieved from this node by callinggetUserData
with the same key.
- Specified by:
- setUserData in interface org.w3c.dom.Node
- Parameters:
key
- The key to associate the object to.data
- The object to associate to the given key, ornull
to remove any existing association to that key.handler
- The handler to associate to that key, ornull
.
- Returns:
- Returns the
DOMObject
previously associated to the given key on this node, ornull
if there was none.
- Since:
- DOM Level 3
protected void synchronizeData()
Override this method in subclass to hook in efficient internal data structure.
public String toString()
NON-DOM method for debugging convenience.