* @param root root node state
* @return read-only node type manager
*/
@Nonnull
public static ReadOnlyNodeTypeManager getInstance(NodeState root) {
Tree tree = new ReadOnlyTree(root).getLocation()
.getChild(NODE_TYPES_PATH.substring(1)).getTree();
final Tree types = tree == null
? new ReadOnlyTree(MemoryNodeState.EMPTY_NODE) // No node types in content, use an empty node
: tree;
return new ReadOnlyNodeTypeManager() {
@Override
protected Tree getTypes() {