com.alibaba.fastjson.JSONPath.set()方法的使用及代码示例

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

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

JSONPath.set介绍

暂无

代码示例

代码示例来源:origin: alibaba/fastjson

public boolean set(Object rootObject, Object value) {
  return set(rootObject, value, true);
}

代码示例来源:origin: com.alibaba/fastjson

public boolean set(Object rootObject, Object value) {
  return set(rootObject, value, true);
}

代码示例来源:origin: alibaba/fastjson

public static boolean set(Object rootObject, String path, Object value) {
  JSONPath jsonpath = compile(path);
  return jsonpath.set(rootObject, value);
}

代码示例来源:origin: com.alibaba/fastjson

public static boolean set(Object rootObject, String path, Object value) {
  JSONPath jsonpath = compile(path);
  return jsonpath.set(rootObject, value);
}

代码示例来源:origin: sd4324530/fastweixin

for (Object sub : subList) {
  Object type = JSONPath.eval(sub, "$.type");
  JSONPath.set(sub, "$.type", type.toString().toUpperCase());
JSONPath.set(button, "$.type", type.toString().toUpperCase());

代码示例来源:origin: sd4324530/fastweixin

for (Object sub : subList) {
  Object type = JSONPath.eval(sub, "$.type");
  JSONPath.set(sub, "$.type", type.toString().toUpperCase());
JSONPath.set(button, "$.type", type.toString().toUpperCase());

代码示例来源:origin: sd4324530/fastweixin

for (Object sub : subList) {
  Object type = JSONPath.eval(sub, "$.type");
  JSONPath.set(sub, "$.type", type.toString().toUpperCase());
JSONPath.set(button, "$.type", type.toString().toUpperCase());

代码示例来源:origin: com.pentahohub.nexus/nexus-weixin

@Override
  public void processExtra(Object object, String key, Object value) {
    JSONPath.set(object, "$.content", value);
  }
};

代码示例来源:origin: com.pentahohub.nexus/nexus-weixin

@Override
  public void processExtra(Object object, String key, Object value) {
    if (key.equals("news_info")) {
      JSONArray news = ((JSONObject) value).getJSONArray("list");
      List<MpArticle> newsList = new ArrayList<MpArticle>(news.size());
      for (int i = 0; i < news.size(); i++) {
        newsList.add(JSON.parseObject(news.getString(i), MpArticle.class, ArticleExtraProcessor.global));
      }
      JSONPath.set(object, "$.content", newsList);
    } else {
      JSONPath.set(object, "$.content", value);
    }
  }
};

代码示例来源:origin: com.bbossgroups.pdp/bboss-pdp-fastwx

for (Object sub : subList) {
  Object type = JSONPath.eval(sub, "$.type");
  JSONPath.set(sub, "$.type", type.toString().toUpperCase());
JSONPath.set(button, "$.type", type.toString().toUpperCase());

代码示例来源:origin: com.bbossgroups.pdp/bboss-pdp-fastwx

for (Object sub : subList) {
  Object type = JSONPath.eval(sub, "$.type");
  JSONPath.set(sub, "$.type", type.toString().toUpperCase());
JSONPath.set(button, "$.type", type.toString().toUpperCase());

代码示例来源:origin: com.bbossgroups.pdp/bboss-pdp-fastwx

for (Object sub : subList) {
  Object type = JSONPath.eval(sub, "$.type");
  JSONPath.set(sub, "$.type", type.toString().toUpperCase());
JSONPath.set(button, "$.type", type.toString().toUpperCase());

代码示例来源:origin: com.pentahohub.nexus/nexus-weixin

/**
 * 获取公众号当前使用的自定义菜单的配置,如果公众号是通过API调用设置的菜单,则返回菜单的开发配置,
 * 而如果公众号是在公众平台官网通过网站功能发布菜单,则本接口返回运营者设置的菜单配置。
 * 
 * @return 菜单集合
 * @see {@link com.pentahohub.nexus.weixin.mp.service.MenuService#getMenu()}
 * @see <a
 *      href="http://mp.weixin.qq.com/wiki/17/4dc4b0514fdad7a5fbbd477aa9aab5ed.html">获取自定义菜单配置</a>
 * @see com.pentahohub.nexus.weixin.domain.Button
 * @see com.pentahohub.nexus.weixin.mp.domain.MenuSetting
 * @see com.pentahohub.nexus.weixin.domain.tuple.MpArticle
 * @throws WeixinException
 */
public MenuSetting getMenuSetting() throws WeixinException {
  Token token = tokenHolder.getToken();
  WeixinResponse response = weixinClient.get(String.format(MENU_GET_SELFMENU_URI, token.getAccessToken()));
  JSONObject result = response.getAsJson();
  JSONArray buttons = result.getJSONObject("selfmenu_info").getJSONArray("button");
  List<Button> buttonList = new ArrayList<Button>(buttons.size());
  JSONObject buttonObj = null;
  for (int i = 0; i < buttons.size(); i++) {
    buttonObj = buttons.getJSONObject(i);
    if (buttonObj.containsKey("sub_button")) {
      JSONPath.set(buttonObj, "$.sub_button", buttonObj.getJSONObject("sub_button").getJSONArray("list"));
    }
    buttonList.add(JSON.parseObject(buttonObj.toJSONString(), Button.class, ButtonExtraProcessor.global));
  }
  return new MenuSetting(result.getBooleanValue("is_menu_open"), buttonList);
}

相关文章