code: public static Object fromJsonParser(JsonParser jp) throws IOException {
          Object rval;
          final JsonToken initialToken = jp.nextToken();
  
          if (initialToken == JsonToken.START_ARRAY) {
              rval = jp.readValueAs(List.class);
          } else if (initialToken == JsonToken.START_OBJECT) {
              rval = jp.readValueAs(Map.class);
          } else if (initialToken == JsonToken.VALUE_STRING) {
              rval = jp.readValueAs(String.class);
          } else if (initialToken == JsonToken.VALUE_FALSE || initialToken == JsonToken.VALUE_TRUE) {
              rval = jp.readValueAs(Boolean.class);
          } else if (initialToken == JsonToken.VALUE_NUMBER_FLOAT
                  || initialToken == JsonToken.VALUE_NUMBER_INT) {
              rval = jp.readValueAs(Number.class);
          } else if (initialToken == JsonToken.VALUE_NULL) {
              rval = null;
          } else {
              throw new JsonParseException(jp,
                      "document doesn't start with a valid json element : " + initialToken,
                      jp.getCurrentLocation());
          }
  
          JsonToken t;
          try {
              t = jp.nextToken();
          } catch (final JsonParseException ex) {
              throw new JsonParseException(jp,
                      "Document contains more content after json-ld element - (possible mismatched {}?)",
                      jp.getCurrentLocation());
          }
          if (t != null) {
              throw new JsonParseException(jp,
                      "Document contains possible json content after the json-ld element - (possible mismatched {}?)",
                      jp.getCurrentLocation());
          }
          return rval;
      }
docs: Parses a JSON-LD document from the given {@link JsonParser} to an object
  that can be used as input for the {@link JsonLdApi} and
  {@link JsonLdProcessor} methods.
  
  @param jp
  The JSON-LD document in a {@link JsonParser}.
  @return A JSON Object.
  @throws JsonParseException
  If there was a JSON related error during parsing.
  @throws IOException
  If there was an IO error during parsing.