Create a Card object from a raw JSON string.

@param jsonString the JSON string representing the potential Card
@return A Card if one can be made from the JSON, or {@code null} if one cannot be made
or the JSON is invalid.
191512
@Nullable
    public static Card fromString(@NonNull String jsonString) {
        try {
            JSONObject jsonObject = new JSONObject(jsonString);
            return fromJson(jsonObject);
        } catch (JSONException ignored) {
            return null;
        }
    }
459701
public T parse(String jsonString) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(jsonString);
        jsonParser.nextToken();
        return parse(jsonParser);
    }
878570
public static Object fromJsonString(String jsonString, ClassLoader classLoader) {
        return fromJsonString(jsonString, Object.class, classLoader);
    }
735533
public static RegistrationRequest fromJson(Map<String, Object> raw) throws JsonException {
    // If we could, we'd just get Json to coerce this for us, but that would lead to endless
    // recursion as the first thing it would do would be to call this very method. *sigh*
    Json json = new Json();
    RegistrationRequest request = new RegistrationRequest();

    if (raw.get("name") instanceof String) {
      request.name = (String) raw.get("name");
    }

    if (raw.get("description") instanceof String) {
      request.description = (String) raw.get("description");
    }

    if (raw.get("configuration") instanceof Map) {
      // This is nasty. Look away now!
      String converted = json.toJson(raw.get("configuration"));
      request.configuration = GridConfiguredJson.toType(converted, GridNodeConfiguration.class);
    }
    
    if (raw.get("configuration") instanceof GridNodeConfiguration) {
      request.configuration = (GridNodeConfiguration)raw.get("configuration");
    }

    return request;
  }
38878
public static String stringify(final JsonNode json) {
        try {
            return json != null ? createObjectMapper().writeValueAsString(json) : "{}";
        } catch (JsonProcessingException jpx) {
            throw new RuntimeException("A problem occurred while stringifying a JsonNode: " + jpx.getMessage(), jpx);
        }
    }
640119
public static function parseJson($jsonString)
    {
        $jsonObj = json_decode($jsonString, true);
        $jsonCheck = json_last_error();
        if ($jsonObj === null && $jsonCheck !== JSON_ERROR_NONE) {
            $msg = "Invalid json string: $jsonString -- "
                . "json_last_error() returns $jsonCheck";
            throw new Error\ParseException($msg);
        }
        return self::constructFrom($jsonObj);
    }
111021
public static SchemaBuilder fromJson(String json) {
        try {
            return JsonSerializer.fromString(json, SchemaBuilder.class);
        } catch (IOException e) {
            throw new IndexException(e, "Unparseable JSON schema: {}: {}", e.getMessage(), json);
        }
    }
219216
@Nonnull
    private JsonToken nextSymbol() {
        lastChar = 0;
        return new JsonToken(JsonToken.Type.SYMBOL, buffer, bufferOffset, 1, lineNo, linePos);
    }
1006347
protected JSONObject getJSONObject(final String jsonString) {
    JSONObject json = new JSONObject();
    try {
      json = new JSONObject(jsonString);
    }
    catch(NullPointerException e) {
      LOGGER.error("JSON string cannot be null.", e);
    }
    catch(JSONException e) {
      LOGGER.error("Could not parse string into JSONObject.", e);
    }
    return json;
  }
976745
@SuppressWarnings("unchecked")
    public BaseBo fromJson(String jsonString) {
        Map<String, Object> dataMap = null;
        try {
            dataMap = jsonString != null ? SerializationUtils.fromJsonString(jsonString, Map.class)
                    : null;
        } catch (Exception e) {
            dataMap = null;
        }
        return fromMap(dataMap);
    }
514807
public Map<String, Object> fromJson(String json) throws IOException {
    if (json == null) {
      throw new IllegalArgumentException("json == null");
    }
    if (json.length() == 0) {
      throw new IllegalArgumentException("json empty");
    }
    return fromJson(new StringReader(json));
  }
513193
public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
        return objectMapper.writeValueAsString(toObject(attributeCollection));
    }
533285
public static String getString(JSONValue value) {
        if (value == null)
            return null;
        if (!(value instanceof JSONString))
            throw new JSONException(NOT_A_STRING);
        return ((JSONString)value).toString();
    }
105019
public static final AuthToken fromJSON(String json) {
        try {
            return mapper.reader(AuthToken.class).readValue(json);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
675073
public String toJsonString() {
        try {
            JSONArray array = new JSONArray();
            for (PebbleTuple t : tuples.values()) {
                array.put(serializeTuple(t));
            }
            return array.toString();
        } catch (JSONException je) {
            je.printStackTrace();
        }
        return null;
    }
229251
private function getSingleMemberShipFromJsonResponse($jsonString)
    {
        $membership = Membership::createFromJsonResponse($jsonString);
        if (\is_array($membership)) {
            throw new \RuntimeException("Something went wrong, return was an array, but shouldn't be");
        }

        return $membership;
    }
14888
public static <T extends MailChimpObject> T fromJson(String json, Class<T> clazz) {
		try {
			return MailChimpGsonFactory.createGson().fromJson(json, clazz);
		} catch(JsonParseException e) {
			throw new IllegalArgumentException(e);
		}
	}