private void parse(String json) throws JsonException {
        final String res = json.trim();

        // Try trivial variants
        if ("{}".equals(res) || "{ }".equals(res)) { // Empty Object
            this.type = JsonType.OBJECT;
            objectData = new HashMap<>();
            return;
        }
        if ("[]".equals(res) || "[ ]".equals(res)) { // Empty Array
            this.type = JsonType.ARRAY;
            arrayData = new ArrayList<>();
            return;
        }

        try {
            final String firstChar = res.substring(0, 1);
            switch (firstChar) {
                case "{":
                    parseObject(res); // JSON Object { key1 : value1, key2 : value2, ... }
                    break;
                case "[":
                    parseArray(res); // JSON Array [value1, value2, ...]
                    break;
                case "\"":
                    parseString(res); // JSON String "some STRING"
                    break;
                default:
                    parseOther(res); // Any other
                    break;
            }

        } catch (JsonException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new JsonException("JSON Parse error: " + ex.getMessage());
        }
    }