com.jayway.jsonpath.spi.json.JsonProvider.createArray()方法的使用及代码示例

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

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

JsonProvider.createArray介绍

[英]Creates a provider specific json array
[中]创建特定于提供程序的json数组

代码示例

代码示例来源:origin: json-path/JsonPath

public EvaluationContextImpl(Path path, Object rootDocument, Configuration configuration, boolean forUpdate) {
  notNull(path, "path can not be null");
  notNull(rootDocument, "root can not be null");
  notNull(configuration, "configuration can not be null");
  this.forUpdate = forUpdate;
  this.path = path;
  this.rootDocument = rootDocument;
  this.configuration = configuration;
  this.valueResult = configuration.jsonProvider().createArray();
  this.pathResult = configuration.jsonProvider().createArray();
  this.updateOperations = new ArrayList<PathRef>();
}

代码示例来源:origin: json-path/JsonPath

Object res = path.evaluate(jsonObject, jsonObject, configuration).getValue(false);
  if (optAlwaysReturnList && path.isDefinite()) {
    Object array = configuration.jsonProvider().createArray();
    configuration.jsonProvider().setArrayIndex(array, 0, res);
    return (T) array;
} else {
  if (optAsPathList) {
    return (T) configuration.jsonProvider().createArray();
  } else {
    if (optAlwaysReturnList) {
      return (T) configuration.jsonProvider().createArray();
    } else {
      return (T) (path.isDefinite() ? null : configuration.jsonProvider().createArray());

代码示例来源:origin: com.jayway.jsonpath/json-path

public EvaluationContextImpl(Path path, Object rootDocument, Configuration configuration, boolean forUpdate) {
  notNull(path, "path can not be null");
  notNull(rootDocument, "root can not be null");
  notNull(configuration, "configuration can not be null");
  this.forUpdate = forUpdate;
  this.path = path;
  this.rootDocument = rootDocument;
  this.configuration = configuration;
  this.valueResult = configuration.jsonProvider().createArray();
  this.pathResult = configuration.jsonProvider().createArray();
  this.updateOperations = new ArrayList<PathRef>();
}

代码示例来源:origin: com.jayway.jsonpath/json-path

Object res = path.evaluate(jsonObject, jsonObject, configuration).getValue(false);
  if (optAlwaysReturnList && path.isDefinite()) {
    Object array = configuration.jsonProvider().createArray();
    configuration.jsonProvider().setArrayIndex(array, 0, res);
    return (T) array;
} else {
  if (optAsPathList) {
    return (T) configuration.jsonProvider().createArray();
  } else {
    if (optAlwaysReturnList) {
      return (T) configuration.jsonProvider().createArray();
    } else {
      return (T) (path.isDefinite() ? null : configuration.jsonProvider().createArray());

代码示例来源:origin: com.github.lafa.jsonpath/json-path

public EvaluationContextImpl(Path path, Object rootDocument, Configuration configuration, boolean forUpdate) {
  notNull(path, "path can not be null");
  notNull(rootDocument, "root can not be null");
  notNull(configuration, "configuration can not be null");
  this.forUpdate = forUpdate;
  this.path = path;
  this.rootDocument = rootDocument;
  this.configuration = configuration;
  this.valueResult = configuration.jsonProvider().createArray();
  this.pathResult = configuration.jsonProvider().createArray();
  this.updateOperations = new ArrayList<PathRef>();
}

代码示例来源:origin: com.github.lafa.jsonpath/json-path

Object res = path.evaluate(jsonObject, jsonObject, configuration).getValue(false);
  if (optAlwaysReturnList && path.isDefinite()) {
    Object array = configuration.jsonProvider().createArray();
    configuration.jsonProvider().setArrayIndex(array, 0, res);
    return (T) array;
} else {
  if (optAsPathList) {
    return (T) configuration.jsonProvider().createArray();
  } else {
    if (optAlwaysReturnList) {
      return (T) configuration.jsonProvider().createArray();
    } else {
      return (T) (path.isDefinite() ? null : configuration.jsonProvider().createArray());

代码示例来源:origin: com.github.lafa.jsonpath/json-path

curr = ctx.configuration().jsonProvider().createMap();
} else if (ctx.configuration().jsonProvider().isArray(propertyVal)) {
  curr = ctx.configuration().jsonProvider().createArray();
} else {
  throw new IllegalArgumentException("unknown type");

相关文章