@SuppressWarnings("checkstyle:FallThrough")
        private final Value jsonTokenToValue(final JsonToken token) throws IOException {
            switch (token) {
                case VALUE_NULL:
                    return ValueFactory.newNil();
                case VALUE_TRUE:
                    return ValueFactory.newBoolean(true);
                case VALUE_FALSE:
                    return ValueFactory.newBoolean(false);
                case VALUE_NUMBER_FLOAT:
                    return ValueFactory.newFloat(this.parser.getDoubleValue());
                case VALUE_NUMBER_INT:
                    try {
                        return ValueFactory.newInteger(this.parser.getLongValue());
                    } catch (final com.fasterxml.jackson.core.JsonParseException ex) {
                        return ValueFactory.newInteger(this.parser.getBigIntegerValue());
                    }
                case VALUE_STRING:
                    return ValueFactory.newString(this.parser.getText());
                case START_ARRAY: {
                    final List<Value> list = new ArrayList<>();
                    while (true) {
                        final JsonToken nextToken = this.parser.nextToken();
                        if (nextToken == JsonToken.END_ARRAY) {
                            return ValueFactory.newArray(list);
                        } else if (nextToken == null) {
                            throw new org.embulk.spi.json.JsonParseException(
                                    "Unexpected end of JSON at "
                                            + this.parser.getTokenLocation()
                                            + " while expecting an element of an array: "
                                            + sampleJsonString());
                        }
                        list.add(this.jsonTokenToValue(nextToken));
                    }
                }
                // Never fall through from the previous branch of START_ARRAY.
                case START_OBJECT:
                    final Map<Value, Value> map = new HashMap<>();
                    while (true) {
                        final JsonToken nextToken = this.parser.nextToken();
                        if (nextToken == JsonToken.END_OBJECT) {
                            return ValueFactory.newMap(map);
                        } else if (nextToken == null) {
                            throw new org.embulk.spi.json.JsonParseException(
                                    "Unexpected end of JSON at "
                                            + this.parser.getTokenLocation()
                                            + " while expecting a key of object: "
                                            + sampleJsonString());
                        }
                        final String key = this.parser.getCurrentName();
                        if (key == null) {
                            throw new org.embulk.spi.json.JsonParseException(
                                    "Unexpected token "
                                            + nextToken
                                            + " at "
                                            + this.parser.getTokenLocation()
                                            + ": "
                                            + sampleJsonString());
                        }
                        final JsonToken nextNextToken = this.parser.nextToken();
                        if (nextNextToken == null) {
                            throw new org.embulk.spi.json.JsonParseException(
                                    "Unexpected end of JSON at "
                                            + this.parser.getTokenLocation()
                                            + " while expecting a value of object: "
                                            + sampleJsonString());
                        }
                        final Value value = this.jsonTokenToValue(nextNextToken);
                        map.put(ValueFactory.newString(key), value);
                    }
                // Never fall through from the previous branch of START_OBJECT.
                case VALUE_EMBEDDED_OBJECT:
                case FIELD_NAME:
                case END_ARRAY:
                case END_OBJECT:
                case NOT_AVAILABLE:
                default:
                    throw new org.embulk.spi.json.JsonParseException(
                            "Unexpected token " + token + " at " + this.parser.getTokenLocation() + ": " + sampleJsonString());
            }
        }
Parses the stringified JSON {@link java.lang.String} with the specified offset to {@link org.msgpack.value.Value}.

@param json  stringified JSON to parse
@param offsetInJsonPointer  offset in JSON Pointer to parse
@return parsed {@link org.msgpack.value.Value}
embulk-deps/src/main/java/org/embulk/deps/json/JsonParserDelegateImpl.java