本文整理了Java中com.github.openjson.JSONObject.quote()
方法的一些代码示例,展示了JSONObject.quote()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.quote()
方法的具体详情如下:
包路径:com.github.openjson.JSONObject
类名称:JSONObject
方法名:quote
[英]Encodes data as a JSON string. This applies quotes and any necessary character escaping.
[中]将数据编码为JSON字符串。这将应用引号和任何必要的字符转义。
代码示例来源:origin: sebfz1/wicket-jquery-ui
/**
* Converts a string to its javascript representation. ie: "myvalue" (with the double quotes)
*
* @param value the object
* @return the JSON value
*/
public static String asString(String value)
{
return JSONObject.quote(value);
}
代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-jquery-ui-core
/**
* Converts a string to its javascript representation. ie: "myvalue" (with the double quotes)
*
* @param value the object
* @return the JSON value
*/
public static String asString(String value)
{
return JSONObject.quote(value);
}
代码示例来源:origin: sebfz1/wicket-jquery-ui
/**
* Quotes (and escapes) the content<br>
* <b>Warning:</b> override with care
*
* @param content the content, likely html
* @return the quoted content
*/
protected String quote(String content)
{
return JSONObject.quote(content);
}
代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-jquery-ui-core
/**
* Helper method that appends a key/value JSON pair to the specified builder. The value will be quoted
*
* @param builder the {@link StringBuilder}
* @param key the key
* @param value the value
*/
public static void append(StringBuilder builder, String key, String value)
{
builder.append(JSONObject.quote(key)).append(": ").append(JSONObject.quote(value));
}
}
代码示例来源:origin: sebfz1/wicket-jquery-ui
/**
* Helper method that appends a key/value JSON pair to the specified builder. The value will be quoted
*
* @param builder the {@link StringBuilder}
* @param key the key
* @param value the value
*/
public static void append(StringBuilder builder, String key, String value)
{
builder.append(JSONObject.quote(key)).append(": ").append(JSONObject.quote(value));
}
}
代码示例来源:origin: sebfz1/wicket-jquery-ui
/**
* Helper method that appends a key/value JSON pair to the specified builder<br>
* The value will *not* be quoted, except if the value is {@code null}, {@code "null"} will be returned.
*
* @param builder the {@link StringBuilder}
* @param key the key
* @param value the object
*/
public static void append(StringBuilder builder, String key, Object value)
{
builder.append(JSONObject.quote(key)).append(": ").append(String.valueOf(value));
}
代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-jquery-ui-core
/**
* Helper method that appends a key/value JSON pair to the specified builder<br>
* The value will *not* be quoted, except if the value is {@code null}, {@code "null"} will be returned.
*
* @param builder the {@link StringBuilder}
* @param key the key
* @param value the object
*/
public static void append(StringBuilder builder, String key, Object value)
{
builder.append(JSONObject.quote(key)).append(": ").append(String.valueOf(value));
}
代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-kendo-ui
@Override
public String render(T object)
{
return String.format("%s: %s, %s: %s", JSONObject.quote(this.getTextField()), JSONObject.quote(this.getText(object)), JSONObject.quote(this.getValueField()), JSONObject.quote(this.getValue(object)));
}
}
代码示例来源:origin: sebfz1/wicket-jquery-ui
@Override
public String render(T object)
{
return String.format("%s: %s", JSONObject.quote(this.getTextField()), JSONObject.quote(this.getText(object)));
}
代码示例来源:origin: sebfz1/wicket-jquery-ui
@Override
public String render(T object)
{
return String.format("%s: %s, %s: %s", JSONObject.quote(this.getTextField()), JSONObject.quote(this.getText(object)), JSONObject.quote(this.getValueField()), JSONObject.quote(this.getValue(object)));
}
}
代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-jquery-ui-core
@Override
public String render(T object)
{
return String.format("%s: %s", JSONObject.quote(this.getTextField()), JSONObject.quote(this.getText(object)));
}
代码示例来源:origin: sebfz1/wicket-jquery-ui
buttons.append("'text': ").append(JSONObject.quote(button.toString())).append(", ");
代码示例来源:origin: com.googlecode.wicket-jquery-ui/wicket-kendo-ui
builder.append(JSONObject.quote("attributes")).append(": ").append(this.getAttributes()); // caution, not a String value
代码示例来源:origin: sebfz1/wicket-jquery-ui
builder.append(JSONObject.quote("attributes")).append(": ").append(this.getAttributes()); // caution, not a String value
内容来源于网络,如有侵权,请联系作者删除!