org.apache.sling.commons.json.JSONObject.write()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.sling.commons.json.JSONObject.write()方法的一些代码示例,展示了JSONObject.write()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.write()方法的具体详情如下:
包路径:org.apache.sling.commons.json.JSONObject
类名称:JSONObject
方法名:write

JSONObject.write介绍

[英]Write the contents of the JSONObject as JSON text to a writer using JSONRenderer#write(Writer,JSONObject)
[中]使用JSONRenderer#Write(writer,JSONObject)将JSONObject的内容作为JSON文本写入写入器

代码示例

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

@Override
  protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException {
    response.setContentType("application/json");
    response.setCharacterEncoding("UTF-8");
    try {
      json.write(response.getWriter());
    } catch (JSONException e) {
      throw new ServletException(e);
    }
  }
}

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

protected void writeEmptyWidget(String propertyName, SlingHttpServletResponse response) throws IOException,
    JSONException {
  JSONObject rte = createEmptyWidget(propertyName);
  rte.write(response.getWriter());
}

代码示例来源:origin: org.apache.sling/org.apache.sling.commons.json

final Object v = jo.get(k);
if (v instanceof JSONObject) {
  ((JSONObject)v).write(writer);
} else if (v instanceof JSONArray) {
  ((JSONArray)v).write(writer);

代码示例来源:origin: org.apache.sling/org.apache.sling.commons.json

((JSONObject)v).write(writer);
} else if (v instanceof JSONArray) {
  ((JSONArray)v).write(writer);

代码示例来源:origin: Adobe-Consulting-Services/acs-aem-tools

result.write(response.getWriter());
} catch (JSONException e) {
  throw new ServletException(e);

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

obj.write(res.getWriter());
} catch (JSONException e) {
  log.error("exception occurred", e);

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

result.write(response.getWriter());
} catch (JSONException e) {
  throw new ServletException("Unable to generate importer list", e);

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

parent.put("style", "padding: 0px");
parent.accumulate("items", widget);
parent.write(response.getWriter());

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

parent.put("padding", 0);
parent.accumulate("items", widget);
parent.write(response.getWriter());

相关文章