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
| Name | Type | Access | Description |
|---|---|---|---|
composite | boolean | Read | Returns true as this node can have child nodes. |
firstChild | Node | Read | Gets the first child of the node. |
lastChild | Node | Read | Gets the last child of the node. |
count | int | Read | Gets the number of immediate children of this node. |
text | String | Read | Gets the text of this node and of all its children. |
nodeType | int | Read | Gets the type of this node. |
parentNode | CompositeNode | Read | Gets the immediate parent of this node. |
document | DocumentBase | Read | Gets the document to which this node belongs. |
previousSibling | Node | Read | Gets the node immediately preceding this node. |
nextSibling | Node | Read | Gets the node immediately following this node. |
range | Range | Read | Returns a Range object that represents the portion of a document that is contained in this node. |
customNodeId | int | Read/Write | Specifies custom node identifier. |
Methods
| Signature | Description |
|---|---|
isComposite() → boolean | Returns true as this node can have child nodes. |
hasChildNodes() → boolean | Returns true if this node has any child nodes. |
getFirstChild() → Node | Gets the first child of the node. |
getLastChild() → Node | Gets the last child of the node. |
getCount() → int | Gets the number of immediate children of this node. |
getText() → String | Gets the text of this node and of all its children. |
getChildNodes(nodeType: int, isDeep: boolean) → NodeCollection | Returns a live collection of child nodes that match the specified type. |
getChild(nodeType: int, index: int, isDeep: boolean) → Node | Returns an Nth child node that matches the specified type. |
selectNodes(xpath: String) → NodeList | Selects a list of nodes matching the XPath expression. |
selectSingleNode(xpath: String) → Node | Selects 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) → T | Adds the specified node to the end of the list of child nodes for this node. |
prependChild(newChild: T) → T | Adds the specified node to the beginning of the list of child nodes for this node. |
insertAfter(newChild: T, refChild: Node) → T | Inserts the specified node immediately after the specified reference node. |
insertBefore(newChild: T, refChild: Node) → T | Inserts the specified node immediately before the specified reference node. |
removeChild(oldChild: T) → T | Removes 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) → int | Returns the index of the specified child node in the child node array. |
acceptStart(visitor: DocumentVisitor) → int | When implemented in a derived class, calls the VisitXXXStart method of the specified document visitor. |
acceptEnd(visitor: DocumentVisitor) → int | When implemented in a derived class, calls the VisitXXXEnd method of the specified document visitor. |
getNodeType() → int | Gets the type of this node. |
getParentNode() → CompositeNode | Gets the immediate parent of this node. |
getDocument() → DocumentBase | Gets the document to which this node belongs. |
getPreviousSibling() → Node | Gets the node immediately preceding this node. |
getNextSibling() → Node | Gets the node immediately following this node. |
getRange() → Range | Returns a Range object that represents the portion of a document that is contained in this node. |
deepClone(isCloneChildren: boolean) → Node | Calls deepClone(isCloneChildren) on this CompositeNode instance. |
accept(visitor: DocumentVisitor) → boolean | Calls accept(visitor) on this CompositeNode instance. |
getAncestor(ancestorType: Class) → CompositeNode | Gets the first ancestor of the specified object type. |
getAncestor(ancestorType: int) → CompositeNode | Gets the first ancestor of the specified NodeType. |
remove() | Removes itself from the parent. |
nextPreOrder(rootNode: Node) → Node | Gets next node according to the pre-order tree traversal algorithm. |
previousPreOrder(rootNode: Node) → Node | Gets the previous node according to the pre-order tree traversal algorithm. |
toString(saveFormat: int) → String | Exports the content of the node into a string in the specified format. |
toString(saveOptions: SaveOptions) → String | Exports the content of the node into a string using the specified save options. |
nodeTypeToString(nodeType: int) → String | A utility method that converts a node type enum value into a user friendly string. |
getCustomNodeId() → int | Specifies custom node identifier. |
setCustomNodeId(value: int) | Sets the custom node id value. |
toString() → String | Calls toString on this CompositeNode instance. |