Node
Overview
Node is a class in Aspose.Words FOSS for Java.
Inherits from: Cloneable.
Base class for all nodes of a Word document.
Edition status of its 27 listed members (a property and its accessor methods are listed separately, overloads once): 26 not yet exercised by a verified example.
This class declares 21 methods for Node objects in Java programs.
Available methods include: accept, deepClone, getAncestor, getCustomNodeId, getDocument, getNextSibling, getNodeType, getParentNode, getPreviousSibling, getRange, getText, isComposite, and 6 additional methods.
Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package.
Properties: composite, customNodeId, document, nextSibling, nodeType, parentNode, and 3 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
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. |
composite | boolean | Read | Returns true if this node can contain other nodes. |
range | Range | Read | Returns a Range object that represents the portion of a document that is contained in this node. |
text | String | Read | Gets the text of this node and of all its children. |
customNodeId | int | Read/Write | Specifies custom node identifier. |
Methods
| Signature | Description |
|---|---|
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. |
isComposite() → boolean | Returns true if this node can contain other nodes. |
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 Node instance. |
accept(visitor: DocumentVisitor) → boolean | Calls accept(visitor) on this Node instance. |
getText() → String | Gets the text of this node and of all its children. |
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 Node instance. |