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

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

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

JSONObject.getJSONObject介绍

[英]Get the JSONObject value associated with a key.
[中]获取与键关联的JSONObject值。

代码示例

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

@Override
public void updatePageInfo(SlingHttpServletRequest request, JSONObject info, Resource resource)
    throws JSONException {
  if (info.has(KEY_WORKFLOWS)) {
    final JSONObject workflows = info.getJSONObject(KEY_WORKFLOWS);
    final String resourcePath = resource.getPath();
    final ResourceResolver resourceResolver = resource.getResourceResolver();
    for (final Iterator<String> types = workflows.keys(); types.hasNext();) {
      final String type = types.next();
      final JSONObject typeObject = workflows.getJSONObject(type);
      filter(typeObject, resourcePath, resourceResolver);
    }
  } else {
    log.warn("No workflows found in existing page info. Check order of cq:infoProviders.");
  }
}

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

@Override
@SuppressWarnings( "deprecation" )
public void updatePageInfo(SlingHttpServletRequest request, org.apache.sling.commons.json.JSONObject info, Resource resource)
    throws org.apache.sling.commons.json.JSONException {
  if (info.has(KEY_WORKFLOWS)) {
    final org.apache.sling.commons.json.JSONObject workflows = info.getJSONObject(KEY_WORKFLOWS);
    final String resourcePath = resource.getPath();
    final ResourceResolver resourceResolver = resource.getResourceResolver();
    for (final Iterator<String> types = workflows.keys(); types.hasNext();) {
      final String type = types.next();
      final org.apache.sling.commons.json.JSONObject typeObject = workflows.getJSONObject(type);
      filter(typeObject, resourcePath, resourceResolver);
    }
  } else {
    log.warn("No workflows found in existing page info. Check order of cq:infoProviders.");
  }
}

代码示例来源:origin: io.wcm/io.wcm.caconfig.editor

private ConfigurationPersistData parseConfigData(JSONObject item, ConfigurationMetadata configMetadata) throws JSONException {
 Map<String, Object> props = new HashMap<>();
 JSONObject properties = item.getJSONObject("properties");
 Iterator<String> propertyNames = properties.keys();
 while (propertyNames.hasNext()) {

相关文章