public static Metadata readMetadataObject(JsonParser jParser) throws IOException {
        Metadata metadata = new Metadata();
        JsonToken token = jParser.currentToken();
        if (token == null) {
            token = jParser.nextToken();
            if (token != JsonToken.START_OBJECT) {
                throw new IOException("expected start object, but got: " + token.name());
            }
            token = jParser.nextToken();
        } else if (token == JsonToken.START_OBJECT) {
            token = jParser.nextToken();
        }

        while (token != JsonToken.END_OBJECT) {
            token = jParser.currentToken();
            if (token != JsonToken.FIELD_NAME) {
                throw new IOException("expected field name, but got: " + token.name());
            }
            String key = jParser.currentName();
            token = jParser.nextToken();
            if (token == JsonToken.START_ARRAY) {
                while (jParser.nextToken() != JsonToken.END_ARRAY) {
                    metadata.add(key, jParser.getText());
                }
            } else {
                if (token != JsonToken.VALUE_STRING) {
                    throw new IOException("expected string value, but found: " + token.name());
                }
                String value = jParser.getValueAsString();
                metadata.set(key, value);
            }
            token = jParser.nextToken();
        }
        return metadata;
    }
expects that jParser has not yet started on object or
for jParser to be pointing to the start object.

@param jParser
@return
@throws IOException
tika-serialization/src/main/java/org/apache/tika/serialization/JsonMetadata.java