referenceNode property

Node referenceNode

Implementation

Node get referenceNode {
    if (!node.container.containers.containsKey(filename)) {
        throw Exception('Field "$tag" of node "${node.tag}" in ${node.container.filename}.json refers to file '
            '"$filename.json" which is not found within the current compilation process.');
    }
    try {
        return node.container.containers[filename]!.nodes.firstWhere((Node n) => (n is Enum || n is Object) && n.tag == referenceTag);
    }
    catch (err) {
        throw Exception('Field "$tag" of node "${node.tag}" in ${node.container.filename}.json refers to node '
            '"$referenceTag" in $filename.json, but such enum/object node does not exist.');
    }
}