public static Object parseJson(String json) {
        if (json == null || json.isEmpty()) {
            throw new IllegalArgumentException("Non-empty JSON string is required");
        }

        boolean hasValue = false;
        Object value = null;
        StringBuilder builder = new StringBuilder();
        for (int i = 0, len = json.length(); i < len; i++) {
            char ch = json.charAt(i);
            if (Character.isWhitespace(ch)) {
                continue;
            } else if (ch == '{') {
                // read object
                Map<String, Object> map = new LinkedHashMap<>();
                i = readJsonObject(json, map, i, len) - 1;
                hasValue = true;
                value = map;
            } else if (ch == '[') {
                // read array
                List<Object> list = new LinkedList<>();
                i = readJsonArray(json, list, i, len) - 1;
                hasValue = true;
                value = list.toArray(new Object[0]);
            } else if (ch == '"') {
                // read string
                i = readUnescapedJsonString(json, builder, i, len) - 1;
                hasValue = true;
                value = builder.toString();
            } else if (ch == '-' || (ch >= '0' && ch <= '9')) {
                // read number
                List<Object> list = new ArrayList<>(1);
                i = readJsonNumber(json, list, i, len) - 1;
                hasValue = true;
                value = list.get(0);
            } else {
                List<Object> list = new ArrayList<>(1);
                i = readJsonConstants(json, list, i, len) - 1;
                hasValue = true;
                value = list.get(0);
            }

            break;
        }

        if (!hasValue) {
            throw new IllegalArgumentException("No value extracted from given JSON string");
        }

        return value;
    }
Simple and un-protected JSON parser.

@param json non-empty JSON string
@return object array, Boolean, Number, null, String, or Map
@throws IllegalArgumentException when JSON string is null or empty
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java