public static boolean walkExpressionTree(final ExpressionItem expressionItem,
                                             final ExpressionItemVisitor itemVisitor) {

        boolean continueWalking = true;
        if (expressionItem != null) {
            if (itemVisitor != null) {
                continueWalking = itemVisitor.visit(expressionItem);
            }
            if (continueWalking) {
                if (expressionItem instanceof ExpressionOperator) {
                    final ExpressionOperator expressionOperator = (ExpressionOperator) expressionItem;
                    final List<ExpressionItem> children = expressionOperator.getChildren();
                    if (children != null && !children.isEmpty()) {
                        for (final ExpressionItem child : children) {
                            continueWalking = walkExpressionTree(child, itemVisitor);
                            if (!continueWalking) {
                                break;
                            }
                        }
                    }
                }
            }
        }
        return continueWalking;
    }
@return True if there are at least one enabled term under the expressionOperator
stroom-query/stroom-query-api/src/main/java/stroom/query/api/ExpressionUtil.java