sb.append(JsonUtils.escapeValue(asString())); return; sb.append(JsonUtils.escapeValue(key)); sb.append(":"); value.stringifySlow(sb);
public String getPayload() { if (isString()) { return JsonUtils.escapeValue(asString()); } if (stringifyFastSupported()) { return stringifyFast(); } return stringifySlow(); }
/** * Returns the JSON formatted value of this string, quoted for evaluating in a * JavaScript interpreter. */ @Override public String toString() { return JsonUtils.escapeValue(value); }
/** * Returns the JSON formatted value of this string, quoted for evaluating in a * JavaScript interpreter. */ @Override public String toString() { return JsonUtils.escapeValue(value); }
public static String quote(String raw) { return JsonUtils.escapeValue(raw); }
private String escapeString(String toEscape) { if (toEscape == null) return null; return JsonUtils.escapeValue(toEscape); }
private void string(String value) { out.append(JsonUtils.escapeValue(value)); }
/** * Visible for testing. */ static String buildPayload(Throwable t) { StringBuilder sb = new StringBuilder(); sb.append("{\"strongName\" : "); sb.append(JsonUtils.escapeValue(GWT.getPermutationStrongName())); sb.append(",\"message\" : "); sb.append(JsonUtils.escapeValue(t.getMessage())); sb.append(",\"stackTrace\" : ["); boolean needsComma = false; for (StackTraceElement e : t.getStackTrace()) { if (needsComma) { sb.append(","); } else { needsComma = true; } sb.append(JsonUtils.escapeValue(e.getMethodName())); } sb.append("]}"); return sb.toString(); }
/** * Converts a JSONObject into a JSON representation that can be used to * communicate with a JSON service. * * @return a JSON string representation of this JSONObject instance */ @Override public String toString() { StringBuilder sb = new StringBuilder("{"); boolean first = true; String[] keys = computeKeys(); for (String key : keys) { if (first) { first = false; } else { sb.append(", "); } sb.append(JsonUtils.escapeValue(key)); sb.append(":"); sb.append(get(key)); } sb.append("}"); return sb.toString(); }
/** * Converts a JSONObject into a JSON representation that can be used to * communicate with a JSON service. * * @return a JSON string representation of this JSONObject instance */ @Override public String toString() { StringBuilder sb = new StringBuilder("{"); boolean first = true; String[] keys = computeKeys(); for (String key : keys) { if (first) { first = false; } else { sb.append(", "); } sb.append(JsonUtils.escapeValue(key)); sb.append(":"); sb.append(get(key)); } sb.append("}"); return sb.toString(); }
private void prepareCommonAttributes(Throwable throwable, IncidentReport report) { report.setTimestamp(TimeUtils.current()); report.setMessage(JsonUtils.escapeValue(throwable.getMessage())); report.setStrongName(JsonUtils.escapeValue(GWT.getPermutationStrongName())); report.setUrl(Window.Location.getHref()); int length = throwable.getStackTrace().length; String[] stackTrace = new String[length]; StackTraceElement[] stackTrace1 = throwable.getStackTrace(); for (int i = 0, stackTrace1Length = stackTrace1.length; i < stackTrace1Length; i++) { StackTraceElement element = stackTrace1[i]; stackTrace[i] = JsonUtils.escapeValue(element.getMethodName()); } report.setStackTrace(stackTrace); }
String escaped = JsonUtils.escapeValue(object.toString()); escaped = escaped.substring(1, escaped.length() - 1); // JsonUtils adds extra quotes
sb.append(JsonUtils.escapeValue(asString())); return; sb.append(JsonUtils.escapeValue(key)); sb.append(":"); value.stringifySlow(sb);
sb.append(JsonUtils.escapeValue(asString())); return; sb.append(JsonUtils.escapeValue(key)); sb.append(":"); value.stringifySlow(sb);
sb.append(JsonUtils.escapeValue(asString())); return; sb.append(JsonUtils.escapeValue(key)); sb.append(":"); value.stringifySlow(sb);
public String getPayload() { if (isString()) { return JsonUtils.escapeValue(asString()); } if (stringifyFastSupported()) { return stringifyFast(); } return stringifySlow(); }
public String getPayload() { if (isString()) { return JsonUtils.escapeValue(asString()); } if (stringifyFastSupported()) { return stringifyFast(); } return stringifySlow(); }
public String getPayload() { if (isString()) { return JsonUtils.escapeValue(asString()); } if (stringifyFastSupported()) { return stringifyFast(); } return stringifySlow(); }