@Override public void onSuccess(UserVerifierDto key) { String jsonConfig = key.getJsonConfiguration(); JSONObject json; //Some verifiers (ex:Trustful) has no jsonConfiguration field if (jsonConfig != null && !jsonConfig.isEmpty()) { json = (JSONObject) JSONParser.parseLenient(jsonConfig); } else { json = new JSONObject(); } json.put("pluginTypeName", new JSONString(key.getPluginTypeName())); json.put("pluginClassName", new JSONString(key.getPluginClassName())); ServletHelper.downloadJsonFile(json.toString(), key.getPluginTypeName() + ".json"); } };
public static String logRecordAsJson(LogRecord lr) { return logRecordAsJsonObject(lr).toString(); }
public static String throwableAsJson(Throwable t) { return throwableAsJsonObject(t).toString(); }
@Override public void onSuccess(LogAppenderDto key) { JSONObject json = (JSONObject) JSONParser.parseLenient(key.getJsonConfiguration()); json.put("minLogSchemaVersion", new JSONNumber(key.getMinLogSchemaVersion())); json.put("maxLogSchemaVersion", new JSONNumber(key.getMaxLogSchemaVersion())); json.put("pluginTypeName", new JSONString(key.getPluginTypeName())); json.put("pluginClassName", new JSONString(key.getPluginClassName())); JSONArray headersStructure = new JSONArray(); for (LogHeaderStructureDto header : key.getHeaderStructure()) { headersStructure.set(headersStructure.size(), new JSONString(header.getValue())); } json.put("headerStructure", headersStructure); ServletHelper.downloadJsonFile(json.toString(), key.getPluginTypeName() + ".json"); } };
/** * Returns a JSON string representation of this key which can be turned back * into a Key instance via * {@link Key#fromJson(ErraiEntityManager, String, boolean)}. * * @see #toJsonObject() * @return a JSON-formatted string. Never null. */ public String toJson() { return toJsonObject().toString(); }
public static <T extends JavaScriptObject> String toJSON( T jso ) { JSONObject obj = new JSONObject( jso ); return obj.toString(); } }
public static <T extends JavaScriptObject> String toJSON( T jso ) { JSONObject obj = new JSONObject( jso ); return obj.toString(); } }
@Override public String toJSONString() { return toJSONObject().toString(); }
@Override public String toJSONString() { return toJSONObject().toString(); }
public final String toJSONString() { return new JSONObject(m_jso).toString(); }
public final String toJSONString() { return new JSONObject(this).toString(); }
@Override public String toJson() { return toJsonObjectInt(false).toString(); }
public final String toJSONString() { return new JSONObject(m_jso).toString(); }
public final String toJSONString() { return new JSONObject(m_jso).toString(); }
public final String toJSONString() { return new JSONObject(m_jso).toString(); }
public final String toJSONString() { return new JSONObject(m_jso).toString(); }
public final String toJavaScript() { try { return new JSONObject(this).toString(); } catch (Exception e) { LOG.log(Level.WARNING, "Unable to obtain the script", e); return this.toString(); } }
@Override public String toJSONString() { final JSONObject object = super.toJSONObject(); object.put("type", new JSONString("ToolTip")); return object.toString(); }
private void store(LightMap<Contact> fromStorage) { JSONObject map = new JSONObject(); LightArray<String> keys = fromStorage.getKeys(); for (int i = 0; i < keys.length(); i++) { Contact contact = fromStorage.get(keys.get(i)); JSONObject jsonContact = ((ContactBrowserImpl) contact).serializeContact(); map.put(contact.getId(), jsonContact); } storage.setItem("gwtphonegap-contact-emulation", map.toString()); }
public final String toJSONString() { JSONObject object = new JSONObject(); object.put("x", new JSONNumber(getX())); object.put("y", new JSONNumber(getY())); object.put("width", new JSONNumber(getWidth())); object.put("height", new JSONNumber(getHeight())); return object.toString(); }