private boolean matchExpression(final SequencedSet<DocRef> nodePath,
                                    final ExplorerNode node,
                                    final ExpressionMatcher expressionMatcher,
                                    final ExpressionOperator expression) {
        if (node.hasNodeFlag(NodeFlag.FILTER_MATCH) && node.getDocRef() != null) {
            // Some value are null, so can't use Map.of
            final Map<String, Object> attributes = new HashMap<>();
            attributes.put(DocumentPermissionFields.DOCUMENT.getFldName(), node.getDocRef());
            attributes.put(DocumentPermissionFields.CHILDREN.getFldName(), createChildrenOfTermMatcher(nodePath));
            attributes.put(DocumentPermissionFields.DESCENDANTS.getFldName(), createDescendantsOfTermMatcher(nodePath));
            attributes.put(DocumentPermissionFields.USER.getFldName(), createUserTermMatcher(node));
            attributes.put(DocumentPermissionFields.DOCUMENT_TYPE.getFldName(), node.getDocRef().getType());
            attributes.put(DocumentPermissionFields.DOCUMENT_UUID.getFldName(), node.getDocRef().getUuid());
            attributes.put(DocumentPermissionFields.DOCUMENT_NAME.getFldName(), node.getDocRef().getName());
            attributes.put(DocumentPermissionFields.DOCUMENT_TAG.getFldName(), node.getTags());
            return expressionMatcher.match(Collections.unmodifiableMap(attributes), expression);
        }

        return false;
    }
Create a map of folders and their child items.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerServiceImpl.java