CompositeNode

Overview

CompositeNode is a class in Aspose.Words FOSS for Java. Inherits from: Node, Iterable<V>, INodeCollection.

Base class for nodes that can contain other nodes.

Edition status of its 49 listed members (a property and its accessor methods are listed separately, overloads once): 48 not yet exercised by a verified example.

This class declares 40 methods for CompositeNode objects in Java programs. Available methods include: accept, acceptEnd, acceptStart, appendChild, deepClone, getAncestor, getChild, getChildNodes, getCount, getCustomNodeId, getDocument, getFirstChild, and 25 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: composite, count, customNodeId, document, firstChild, lastChild, and 6 more.

Properties

NameTypeAccessDescription
compositebooleanReadReturns true as this node can have child nodes.
firstChildNodeReadGets the first child of the node.
lastChildNodeReadGets the last child of the node.
countintReadGets the number of immediate children of this node.
textStringReadGets the text of this node and of all its children.
nodeTypeintReadGets the type of this node.
parentNodeCompositeNodeReadGets the immediate parent of this node.
documentDocumentBaseReadGets the document to which this node belongs.
previousSiblingNodeReadGets the node immediately preceding this node.
nextSiblingNodeReadGets the node immediately following this node.
rangeRangeReadReturns a Range object that represents the portion of a document that is contained in this node.
customNodeIdintRead/WriteSpecifies custom node identifier.

Methods

SignatureDescription
isComposite() → booleanReturns true as this node can have child nodes.
hasChildNodes() → booleanReturns true if this node has any child nodes.
getFirstChild() → NodeGets the first child of the node.
getLastChild() → NodeGets the last child of the node.
getCount() → intGets the number of immediate children of this node.
getText() → StringGets the text of this node and of all its children.
getChildNodes(nodeType: int, isDeep: boolean) → NodeCollectionReturns a live collection of child nodes that match the specified type.
getChild(nodeType: int, index: int, isDeep: boolean) → NodeReturns an Nth child node that matches the specified type.
selectNodes(xpath: String) → NodeListSelects a list of nodes matching the XPath expression.
selectSingleNode(xpath: String) → NodeSelects the first Node that matches the XPath expression.
iterator() → Iterator<V>Provides support for the for each style iteration over the child nodes of this node.
appendChild(newChild: T) → TAdds the specified node to the end of the list of child nodes for this node.
prependChild(newChild: T) → TAdds the specified node to the beginning of the list of child nodes for this node.
insertAfter(newChild: T, refChild: Node) → TInserts the specified node immediately after the specified reference node.
insertBefore(newChild: T, refChild: Node) → TInserts the specified node immediately before the specified reference node.
removeChild(oldChild: T) → TRemoves the specified child node.
removeAllChildren()Removes all the child nodes of the current node.
removeSmartTags()Removes all SmartTag descendant nodes of the current node.
indexOf(child: Node) → intReturns the index of the specified child node in the child node array.
acceptStart(visitor: DocumentVisitor) → intWhen implemented in a derived class, calls the VisitXXXStart method of the specified document visitor.
acceptEnd(visitor: DocumentVisitor) → intWhen implemented in a derived class, calls the VisitXXXEnd method of the specified document visitor.
getNodeType() → intGets the type of this node.
getParentNode() → CompositeNodeGets the immediate parent of this node.
getDocument() → DocumentBaseGets the document to which this node belongs.
getPreviousSibling() → NodeGets the node immediately preceding this node.
getNextSibling() → NodeGets the node immediately following this node.
getRange() → RangeReturns a Range object that represents the portion of a document that is contained in this node.
deepClone(isCloneChildren: boolean) → NodeCalls deepClone(isCloneChildren) on this CompositeNode instance.
accept(visitor: DocumentVisitor) → booleanCalls accept(visitor) on this CompositeNode instance.
getAncestor(ancestorType: Class) → CompositeNodeGets the first ancestor of the specified object type.
getAncestor(ancestorType: int) → CompositeNodeGets the first ancestor of the specified NodeType.
remove()Removes itself from the parent.
nextPreOrder(rootNode: Node) → NodeGets next node according to the pre-order tree traversal algorithm.
previousPreOrder(rootNode: Node) → NodeGets the previous node according to the pre-order tree traversal algorithm.
toString(saveFormat: int) → StringExports the content of the node into a string in the specified format.
toString(saveOptions: SaveOptions) → StringExports the content of the node into a string using the specified save options.
nodeTypeToString(nodeType: int) → StringA utility method that converts a node type enum value into a user friendly string.
getCustomNodeId() → intSpecifies custom node identifier.
setCustomNodeId(value: int)Sets the custom node id value.
toString() → StringCalls toString on this CompositeNode instance.

See Also