protected boolean isExpressionSimple(String expression) {
        boolean insideString = false;
        for (int i = 0; i < expression.length(); i++) {
            char c = expression.charAt(i);
            if (c == '"') {
                if (!insideString) {
                    insideString = true;
                } else if (i > 0 && expression.charAt(i - 1) != '\\') {
                    insideString = false;
                }
                continue;
            }
            if (insideString) {
                continue;
            }

            boolean insideWhitelist = false;
            for (int j = 0; j < SIMPLE_EXPRESSION_WHITELIST.length && !insideWhitelist; j++) {
                insideWhitelist = c == SIMPLE_EXPRESSION_WHITELIST[j];
            }

            if (!insideWhitelist) {
                return false;
            }
        }

        return true;
    }