/** * Compares {@link JSONString} provided to the expected {@code JSONString}, checking that the * {@link org.json.JSONString#toJSONString()} are equal. * * @param expected Expected {@code JSONstring} * @param actual {@code JSONstring} to compare * @return result of the comparison */ public static JSONCompareResult compareJson(final JSONString expected, final JSONString actual) { final JSONCompareResult result = new JSONCompareResult(); final String expectedJson = expected.toJSONString(); final String actualJson = actual.toJSONString(); if (!expectedJson.equals(actualJson)) { result.fail(""); } return result; }
Object object; try { object = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
Object o; try { o = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
out.append(((JSONString) value).toJSONString()); return this;
Object object; try { object = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
Object o; try { o = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
/** * Compares {@link JSONString} provided to the expected {@code JSONString}, checking that the * {@link org.json.JSONString#toJSONString()} are equal. * * @param expected Expected {@code JSONstring} * @param actual {@code JSONstring} to compare * @return result of the comparison */ public static JSONCompareResult compareJson(final JSONString expected, final JSONString actual) { final JSONCompareResult result = new JSONCompareResult(); final String expectedJson = expected.toJSONString(); final String actualJson = actual.toJSONString(); if (!expectedJson.equals(actualJson)) { result.fail(""); } return result; }
Object o; try { o = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
String object; try { object = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
private static Coordinate getCoordinateFromGJSON(JSONObject gjson) { Object pc = gjson.getJSONObject(GeoJsonWriter.GEOMETRY).get( GeoJsonWriter.COORDINATES); if (pc instanceof JSONArray) { return new Coordinate(((JSONArray) pc).getDouble(0), ((JSONArray) pc).getDouble(1)); } else if (pc instanceof JSONString) { String[] split = StringUtils.split( ((JSONString) pc).toJSONString(), ",[]"); return new Coordinate(Double.parseDouble(split[0]), Double.parseDouble(split[1])); } return null; }
public static String generateArgs(Object[] methodArguments) { String[] argsArray = new String[methodArguments.length]; for (int i = 0; i < methodArguments.length; ++i) { Object value = convert(methodArguments[i]); if (value == null) { argsArray[i] = "null"; } else if (value instanceof String) { argsArray[i] = JSONObject.quote(value.toString()); } else if (value instanceof JSONString) { argsArray[i] = ((JSONString) value).toJSONString(); } else { argsArray[i] = value.toString(); } } StringBuffer args = new StringBuffer(); for (int i = 0; i < argsArray.length; ++i) { if (i > 0) { args.append(","); } args.append(argsArray[i]); } return args.toString(); } }
entityStream); if (object instanceof JSONString) { writer.write(((JSONString) object).toJSONString()); } else if (object instanceof JSONArray) { writer.write(((JSONArray) object).toString());
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;
Object object; try { object = ((JSONString)value).toJSONString(); } catch (Exception e) { throw new JSONException(e);
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;
Object o = ((JSONString)value).toJSONString(); if (o instanceof String) { return (String)o;