本文整理汇总了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 + "}";
}