Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.dom

public abstract Class ParentNode

extends ChildNode
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl, com.sun.org.apache.xerces.internal.dom.DocumentFragmentImpl, com.sun.org.apache.xerces.internal.dom.DocumentTypeImpl, com.sun.org.apache.xerces.internal.dom.ElementDefinitionImpl, com.sun.org.apache.xerces.internal.dom.ElementImpl, com.sun.org.apache.xerces.internal.dom.EntityImpl, com.sun.org.apache.xerces.internal.dom.EntityReferenceImpl
Imports
java.io.Serializable, .IOException, .ObjectInputStream, .ObjectOutputStream, org.w3c.dom.DOMException, .Document, .Node, .NodeList, .UserDataHandler

ParentNode inherits from ChildNode and adds the capability of having child nodes. Not every node in the DOM can have children, so only nodes that can should inherit from this class and pay the price for it.

ParentNode, just like NodeImpl, also implements NodeList, so it can return itself in response to the getChildNodes() query. This eliminiates the need for a separate ChildNodeList object. Note that this is an IMPLEMENTATION DETAIL; applications should _never_ assume that this identity exists. On the other hand, subclasses may need to override this, in case of conflicting names. This is the case for the classes HTMLSelectElementImpl and HTMLFormElementImpl of the HTML DOM.

While we have a direct reference to the first child, the last child is stored as the previous sibling of the first child. First child nodes are marked as being so, and getNextSibling hides this fact.

Note

Not all parent nodes actually need to also be a child. At some point we used to have ParentNode inheriting from NodeImpl and another class called ChildAndParentNode that inherited from ChildNode. But due to the lack of multiple inheritance a lot of code had to be duplicated which led to a maintenance nightmare. At the same time only a few nodes (Document, DocumentFragment, Entity, and Attribute) cannot be a child so the gain in memory wasn't really worth it. The only type for which this would be the case is Attribute, but we deal with there in another special way, so this is not applicable.

This class doesn't directly support mutation events, however, it notifies the document when mutations are performed so that the document class do so.

Warning

Some of the code here is partially duplicated in AttrImpl, be careful to keep these two classes in sync!

Authors
Arnaud Le Hors, IBM, Joe Kesselman, IBM, Andy Clark, IBM

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
protected ChildNode
firstChild

First child.

protected transient NodeListCache
fNodeListCache

NodeList cache

protected CoreDocumentImpl
ownerDocument

Owner document.

pack-priv static final long
Inherited from com.sun.org.apache.xerces.internal.dom.ChildNode:
nextSiblingpreviousSibling

Constructor Summary

AccessConstructor and Description
protected
ParentNode(CoreDocumentImpl ownerDocument)

No public constructor; only subclasses of ParentNode should be instantiated, and those normally via a Document's factory methods

public
ParentNode()

Constructor for serialization.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
checkNormalizationAfterInsert(ChildNode
the child node that was inserted into this node
insertedChild
)

Checks the normalized state of this node after inserting a child.

pack-priv void
checkNormalizationAfterRemove(ChildNode
the previous sibling of the removed child, or null
previousSibling
)

Checks the normalized of this node after removing a child.

public Node
cloneNode(boolean
If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
deep
)

Overrides com.sun.org.apache.xerces.internal.dom.ChildNode.cloneNode.

Implements org.w3c.dom.Node.cloneNode.

Returns a duplicate of a given node.

public NodeList
getChildNodes()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getChildNodes.

Implements org.w3c.dom.Node.getChildNodes.

Obtain a NodeList enumerating all children of this node.

protected final NodeList
getChildNodesUnoptimized()

Create a NodeList to access children that is use by subclass elements that have methods named getLength() or item(int).

public Node
getFirstChild()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getFirstChild.

Implements org.w3c.dom.Node.getFirstChild.

The first child of this Node, or null if none.

public Node
getLastChild()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getLastChild.

Implements org.w3c.dom.Node.getLastChild.

The last child of this Node, or null if none.

public int

Returns:

int
getLength
()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getLength.

Implements org.w3c.dom.NodeList.getLength.

NodeList method: Count the immediate children of this node

public Document
getOwnerDocument()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getOwnerDocument.

Implements org.w3c.dom.Node.getOwnerDocument.

Find the Document that this Node belongs to (the document in whose context the Node was created).

public String
getTextContent()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getTextContent.

Implements org.w3c.dom.Node.getTextContent.

This attribute returns the text content of this node and its descendants.

pack-priv void
public boolean
pack-priv final boolean
public Node

Returns:

newChild, in its new state (relocated, or emptied in the case of DocumentNode.)
insertBefore
(Node
The Node to be moved to our subtree. As a convenience feature, inserting a DocumentNode will instead insert all its children.
newChild
,
Node
Current child which newChild should be placed immediately before. If refChild is null, the insertion occurs after all existing Nodes, like appendChild().
refChild
)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.insertBefore.

Implements org.w3c.dom.Node.insertBefore.

Move one or more node(s) to our list of children.

pack-priv Node
internalInsertBefore(Node newChild, Node refChild, boolean replace)

NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able to control which mutation events are spawned.

pack-priv Node
internalRemoveChild(Node oldChild, boolean replace)

NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able to control which mutation events are spawned.

public boolean
isEqualNode(Node
The node to compare equality with.
arg
)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.isEqualNode.

Implements org.w3c.dom.Node.isEqualNode.

DOM Level 3 WD- Experimental.

public Node

Returns:

org.w3c.dom.Node
item
(int
int
index
)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.item.

Implements org.w3c.dom.NodeList.item.

NodeList method: Return the Nth immediate child of this node, or null if the index is out of bounds.

pack-priv final ChildNode
pack-priv final void
private int

Returns:

int
nodeListGetLength
()

Count the immediate children of this node.

private Node
nodeListItem(int
int
index
)

Return the Nth immediate child of this node, or null if the index is out of bounds.

public void
normalize()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.normalize.

Implements org.w3c.dom.Node.normalize.

Override default behavior to call normalize() on this Node's children.

pack-priv CoreDocumentImpl
ownerDocument()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.ownerDocument.

same as above but returns internal type and this one is not overridden by CoreDocumentImpl to return null

private void
readObject(ObjectInputStream ois)

Deserialize object.

public Node

Returns:

oldChild, in its new state (removed).
removeChild
(Node
The node being removed.
oldChild
)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.removeChild.

Implements org.w3c.dom.Node.removeChild.

Remove a child from this Node.

public Node

Returns:

oldChild, in its new state (removed).
replaceChild
(Node
The new node to put in the child list.
newChild
,
Node
The node being replaced in the list.
oldChild
)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.replaceChild.

Implements org.w3c.dom.Node.replaceChild.

Make newChild occupy the location that oldChild used to have.

protected void
setOwnerDocument(CoreDocumentImpl doc)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.setOwnerDocument.

NON-DOM set the ownerDocument of this node and its children

public void
setReadOnly(boolean
True or false as desired.
readOnly
,
boolean
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.
deep
)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.setReadOnly.

Override default behavior so that if deep is true, children are also toggled.

public void
setTextContent(String textContent)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.setTextContent.

Implements org.w3c.dom.Node.setTextContent.

This attribute returns the text content of this node and its descendants.

protected void
synchronizeChildren()

Override this method in subclass to hook in efficient internal data structure.

private void
Inherited from com.sun.org.apache.xerces.internal.dom.ChildNode:
getNextSiblinggetParentNodegetPreviousSiblingparentNodepreviousSibling

Field Detail

firstChildback to summary
protected ChildNode firstChild

First child.

fNodeListCacheback to summary
protected transient NodeListCache fNodeListCache

NodeList cache

ownerDocumentback to summary
protected CoreDocumentImpl ownerDocument

Owner document.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xerces.internal.dom.ChildNode.serialVersionUID.

Serialization version.

Constructor Detail

ParentNodeback to summary
protected ParentNode(CoreDocumentImpl ownerDocument)

No public constructor; only subclasses of ParentNode should be instantiated, and those normally via a Document's factory methods

ParentNodeback to summary
public ParentNode()

Constructor for serialization.

Method Detail

checkNormalizationAfterInsertback to summary
pack-priv void checkNormalizationAfterInsert(ChildNode insertedChild)

Checks the normalized state of this node after inserting a child. If the inserted child causes this node to be unnormalized, then this node is flagged accordingly. The conditions for changing the normalized state are:

  • The inserted child is a text node and one of its adjacent siblings is also a text node.
  • The inserted child is is itself unnormalized.
Parameters
insertedChild:ChildNode

the child node that was inserted into this node

Exceptions
NullPointerException:
if the inserted child is null
checkNormalizationAfterRemoveback to summary
pack-priv void checkNormalizationAfterRemove(ChildNode previousSibling)

Checks the normalized of this node after removing a child. If the removed child causes this node to be unnormalized, then this node is flagged accordingly. The conditions for changing the normalized state are:

  • The removed child had two adjacent siblings that were text nodes.
Parameters
previousSibling:ChildNode

the previous sibling of the removed child, or null

cloneNodeback to summary
public Node cloneNode(boolean deep)

Overrides com.sun.org.apache.xerces.internal.dom.ChildNode.cloneNode.

Implements org.w3c.dom.Node.cloneNode.

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.

Example: Cloning a Text node will copy both the node and the text it contains.

Example: Cloning something that has children -- Element or Attr, for example -- will _not_ clone those children unless a "deep clone" has been requested. A shallow clone of an Attr node will yield an empty Attr of the same name.

Note

Clones will always be read/write, even if the node being cloned is read-only, to permit applications using only the DOM API to obtain editable copies of locked portions of the tree.

Parameters
deep:boolean

Doc from org.w3c.dom.Node.cloneNode.

If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).

Returns:Node

Doc from org.w3c.dom.Node.cloneNode.

The duplicate node.

getChildNodesback to summary
public NodeList getChildNodes()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getChildNodes.

Implements org.w3c.dom.Node.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.

getChildNodesUnoptimizedback to summary
protected final NodeList getChildNodesUnoptimized()

Create a NodeList to access children that is use by subclass elements that have methods named getLength() or item(int). ChildAndParentNode optimizes getChildNodes() by implementing NodeList itself. However if a subclass Element implements methods with the same name as the NodeList methods, they will override the actually methods in this class.

To use this method, the subclass should implement getChildNodes() and have it call this method. The resulting NodeList instance maybe shared and cached in a transient field, but the cached value must be cleared if the node is cloned.

getFirstChildback to summary
public Node getFirstChild()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getFirstChild.

Implements org.w3c.dom.Node.getFirstChild.

The first child of this Node, or null if none.

getLastChildback to summary
public Node getLastChild()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getLastChild.

Implements org.w3c.dom.Node.getLastChild.

The last child of this Node, or null if none.

getLengthback to summary
public int getLength()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getLength.

Implements org.w3c.dom.NodeList.getLength.

NodeList method: Count the immediate children of this node

Returns:int

int

getOwnerDocumentback to summary
public Document getOwnerDocument()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getOwnerDocument.

Implements org.w3c.dom.Node.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.

getTextContentback to summary
public String getTextContent() throws DOMException

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getTextContent.

Implements org.w3c.dom.Node.getTextContent.

Doc from com.sun.org.apache.xerces.internal.dom.NodeImpl.getTextContent.

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 single Text 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:

/** 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 single Text 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
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 nodes
ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null
Exceptions
DOMException:
  • NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  • DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.
getTextContentback to summary
pack-priv void getTextContent(StringBuilder buf) throws DOMException

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.getTextContent.

hasChildNodesback to summary
public boolean hasChildNodes()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.hasChildNodes.

Implements org.w3c.dom.Node.hasChildNodes.

Test whether this node has any children. Convenience shorthand for (Node.getFirstChild()!=null)

Returns:boolean

Doc from org.w3c.dom.Node.hasChildNodes.

Returns true if this node has any children, false otherwise.

hasTextContentback to summary
pack-priv final boolean hasTextContent(Node child)
insertBeforeback to summary
public Node insertBefore(Node newChild, Node refChild) throws DOMException

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.insertBefore.

Implements org.w3c.dom.Node.insertBefore.

Move one or more node(s) to our list of children. Note that this implicitly removes them from their previous parent.

Parameters
newChild:Node

The Node to be moved to our subtree. As a convenience feature, inserting a DocumentNode will instead insert all its children.

refChild:Node

Current child which newChild should be placed immediately before. If refChild is null, the insertion occurs after all existing Nodes, like appendChild().

Returns:Node

newChild, in its new state (relocated, or emptied in the case of DocumentNode.)

Exceptions
DOMException:

Doc from org.w3c.dom.Node.insertBefore.

HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to insert a second DocumentType or Element node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the insertion of a DocumentType or Element node.

HIERARCHY_REQUEST_ERR:
if newChild is of a type that shouldn't be a child of this node, or if newChild is an ancestor of this node.
WRONG_DOCUMENT_ERR:
if newChild has a different owner document than we do.
NOT_FOUND_ERR:
if refChild is not a child of this node.
NO_MODIFICATION_ALLOWED_ERR:
if this node is read-only.
internalInsertBeforeback to summary
pack-priv Node internalInsertBefore(Node newChild, Node refChild, boolean replace) throws DOMException

NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able to control which mutation events are spawned. This version of the insertBefore operation allows us to do so. It is not intended for use by application programs.

internalRemoveChildback to summary
pack-priv Node internalRemoveChild(Node oldChild, boolean replace) throws DOMException

NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able to control which mutation events are spawned. This version of the removeChild operation allows us to do so. It is not intended for use by application programs.

isEqualNodeback to summary
public boolean isEqualNode(Node arg)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.isEqualNode.

Implements org.w3c.dom.Node.isEqualNode.

DOM Level 3 WD- Experimental. Override inherited behavior from NodeImpl to support deep equal.

Parameters
arg:Node

Doc from com.sun.org.apache.xerces.internal.dom.NodeImpl.isEqualNode.

The node to compare equality with.

Returns:boolean

Doc from com.sun.org.apache.xerces.internal.dom.NodeImpl.isEqualNode.

If the nodes, and possibly subtrees are equal, true otherwise false.

itemback to summary
public Node item(int index)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.item.

Implements org.w3c.dom.NodeList.item.

NodeList method: Return the Nth immediate child of this node, or null if the index is out of bounds.

Parameters
index:int

int

Returns:Node

org.w3c.dom.Node

lastChildback to summary
pack-priv final ChildNode lastChild()
lastChildback to summary
pack-priv final void lastChild(ChildNode node)
nodeListGetLengthback to summary
private int nodeListGetLength()

Count the immediate children of this node. Use to implement NodeList.getLength().

Returns:int

int

nodeListItemback to summary
private Node nodeListItem(int index)

Return the Nth immediate child of this node, or null if the index is out of bounds. Use to implement NodeList.item().

Parameters
index:int

int

normalizeback to summary
public void normalize()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.normalize.

Implements org.w3c.dom.Node.normalize.

Override default behavior to call normalize() on this Node's children. It is up to implementors or Node to override normalize() to take action.

ownerDocumentback to summary
pack-priv CoreDocumentImpl ownerDocument()

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.ownerDocument.

same as above but returns internal type and this one is not overridden by CoreDocumentImpl to return null

readObjectback to summary
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException

Deserialize object.

removeChildback to summary
public Node removeChild(Node oldChild) throws DOMException

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.removeChild.

Implements org.w3c.dom.Node.removeChild.

Remove a child from this Node. The removed child's subtree remains intact so it may be re-inserted elsewhere.

Parameters
oldChild:Node

Doc from org.w3c.dom.Node.removeChild.

The node being removed.

Returns:Node

oldChild, in its new state (removed).

Exceptions
DOMException:

Doc from org.w3c.dom.Node.removeChild.

NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the removal of the DocumentType child or the Element child.

NOT_FOUND_ERR:
if oldChild is not a child of this node.
NO_MODIFICATION_ALLOWED_ERR:
if this node is read-only.
replaceChildback to summary
public Node replaceChild(Node newChild, Node oldChild) throws DOMException

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.replaceChild.

Implements org.w3c.dom.Node.replaceChild.

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.

Parameters
newChild:Node

Doc from org.w3c.dom.Node.replaceChild.

The new node to put in the child list.

oldChild:Node

Doc from org.w3c.dom.Node.replaceChild.

The node being replaced in the list.

Returns:Node

oldChild, in its new state (removed).

Exceptions
DOMException:

Doc from org.w3c.dom.Node.replaceChild.

HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself, or if this node is of type Document and the result of the replacement operation would add a second DocumentType or Element on the Document node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of the new node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the replacement of the DocumentType child or Element child.

HIERARCHY_REQUEST_ERR:
if newChild is of a type that shouldn't be a child of this node, or if newChild is one of our ancestors.
WRONG_DOCUMENT_ERR:
if newChild has a different owner document than we do.
NOT_FOUND_ERR:
if oldChild is not a child of this node.
NO_MODIFICATION_ALLOWED_ERR:
if this node is read-only.
setOwnerDocumentback to summary
protected void setOwnerDocument(CoreDocumentImpl doc)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.setOwnerDocument.

NON-DOM set the ownerDocument of this node and its children

setReadOnlyback to summary
public void setReadOnly(boolean readOnly, boolean deep)

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.setReadOnly.

Override default behavior so that if deep is true, children are also toggled.

Parameters
readOnly:boolean

Doc from com.sun.org.apache.xerces.internal.dom.NodeImpl.setReadOnly.

True or false as desired.

deep:boolean

Doc from com.sun.org.apache.xerces.internal.dom.NodeImpl.setReadOnly.

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
<P> Note: this will not change the state of an EntityReference or its children, which are always read-only.
setTextContentback to summary
public void setTextContent(String textContent) throws DOMException

Overrides com.sun.org.apache.xerces.internal.dom.NodeImpl.setTextContent.

Implements org.w3c.dom.Node.setTextContent.

Doc from com.sun.org.apache.xerces.internal.dom.NodeImpl.setTextContent.

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 single Text 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 nodes
ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null
Exceptions
DOMException:
  • NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  • DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.
synchronizeChildrenback to summary
protected void synchronizeChildren()

Override this method in subclass to hook in efficient internal data structure.

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Hides com.sun.org.apache.xerces.internal.dom.NodeImpl.writeObject.

Serialize object.

com.sun.org.apache.xerces.internal.dom back to summary

pack-priv Class ParentNode.UserDataRecord

extends Object
implements Serializable
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xerces.internal.dom.ParentNode.UserDataRecord
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
pack-priv Object
pack-priv UserDataHandler
private static final long
serialVersionUID

Serialization version.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fDataback to summary
pack-priv Object fData
Annotations
@SuppressWarnings:serial
fHandlerback to summary
pack-priv UserDataHandler fHandler
Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
private static final long serialVersionUID

Serialization version.

Constructor Detail

UserDataRecordback to summary
pack-priv UserDataRecord(Object data, UserDataHandler handler)