本文整理匯總了Java中org.apache.commons.lang3.StringEscapeUtils.escapeJson方法的典型用法代碼示例。如果您正苦於以下問題:Java StringEscapeUtils.escapeJson方法的具體用法?Java StringEscapeUtils.escapeJson怎麽用?Java StringEscapeUtils.escapeJson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang3.StringEscapeUtils
的用法示例。
在下文中一共展示了StringEscapeUtils.escapeJson方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AuditData
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
/**
* @param userName ユーザ名
* @param funcId 機能I
* @param sqlId SQL-ID
* @param sqlName SQL名
* @param sql SQL文
* @param rowCount
*/
private AuditData(final String userName, final String funcId, final String sqlId, final String sqlName,
final String sql, final int rowCount) {
super();
this.userName = StringEscapeUtils.escapeJson(userName);
this.funcId = StringEscapeUtils.escapeJson(funcId);
this.sqlId = StringEscapeUtils.escapeJson(sqlId);
this.sqlName = StringEscapeUtils.escapeJson(sqlName);
this.sql = StringEscapeUtils.escapeJson(PAT.matcher(sql).replaceAll(" "));
this.rowCount = rowCount;
}
示例2: handleRequestInternal
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
/**
* Handle request.
*
* @param request the request
* @param response the response
* @return the model and view
* @throws Exception the exception
*/
@RequestMapping(method = RequestMethod.GET)
protected ModelAndView handleRequestInternal(
final HttpServletRequest request, final HttpServletResponse response)
throws Exception {
final Map<String, Object> list = getBeans(this.applicationContext);
LOGGER.debug("Found [{}] beans to report", list.size());
final JsonSerializer<Object> serializer = new BeanObjectJsonSerializer();
final StringBuilder builder = new StringBuilder();
builder.append('[');
final Set<Map.Entry<String, Object>> entries = list.entrySet();
final Iterator<Map.Entry<String, Object>> it = entries.iterator();
while (it.hasNext()) {
final Map.Entry<String, Object> entry = it.next();
final Object obj = entry.getValue();
final StringWriter writer = new StringWriter();
writer.append('{');
writer.append('\"' + entry.getKey() + "\":");
serializer.toJson(writer, obj);
writer.append('}');
builder.append(writer);
if (it.hasNext()) {
builder.append(',');
}
}
builder.append(']');
final ModelAndView mv = new ModelAndView(VIEW_CONFIG);
final String jsonData = StringEscapeUtils.escapeJson(builder.toString());
mv.addObject("jsonData", jsonData);
mv.addObject("properties", casProperties.entrySet());
return mv;
}
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:47,代碼來源:InternalConfigStateController.java
示例3: encode
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
private String encode(String str) {
return StringEscapeUtils.escapeJson(str);
}
示例4: getPlanText
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
public String getPlanText() {
return StringEscapeUtils.escapeJson(profile.getPlan());
}
示例5: getDescription
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
public String getDescription() {
return StringEscapeUtils.escapeJson(method.getDescription());
}
示例6: getDescription
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
public String getDescription() throws JsonProcessingException {
return StringEscapeUtils.escapeJson(resource.getDescription());
}
示例7: getExample
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
public String getExample() {
return StringEscapeUtils.escapeJson(example);
}
示例8: getDescription
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
@Override
public String getDescription() {
return StringEscapeUtils.escapeJson(type.getDescription());
}
示例9: toJSON
import org.apache.commons.lang3.StringEscapeUtils; //導入方法依賴的package包/類
/**
* JSON化
*
* @return JSON
*/
public String toJSON() {
return "{\"sqlName\":" + StringEscapeUtils.escapeJson(sqlName) + ",\"md5\":" + md5 + ",\"passRoute\":"
+ passRoute + "}";
}