DocumentsHierarchyNode

How to get DocumentsHierarchyNode

ES2015+:

import DocumentsHierarchyNode from 'fontoxml-documents/DocumentsHierarchyNode'

ES5:

define([
	'fontoxml-documents/DocumentsHierarchyNode'
], function (
	DocumentsHierarchyNode
) {
});

Type: Class

The DocumentsHierarchyNode represents a subtree of the primary hierarchical relationship between documents.

Do not construct documents hierarchy nodes. Instead, obtain them from the DocumentsHierarchy.

Constructor

# Name Type Description
1. [documentReference] DocumentReference
2. [documentsHierarchy] DocumentsHierarchy

Properties

Name Type Description
children Array<DocumentsHierarchyNode>
documentReference DocumentReference | Null

Describes the document being referenced at this point in the hierarchy

parent DocumentsHierarchyNode | Null

Methods

Name Description
addChild

Append a child


  Arguments
# Name Type Description
1. documentsHierarchyNode DocumentsHierarchyNode
getId

Get the unique identifier for this hierarchyNode.


  Returns
removeAllChildren

Remove all the children of this node

setDocumentReference

Should be called to set, change or clear the documentReference for this hierarchy node.


  Arguments
# Name Type Description
1. documentReference DocumentReference | Null

The new document reference, or null if the node should not reference any document.