本文整理了Java中com.jayway.jsonpath.Configuration.mappingProvider()
方法的一些代码示例,展示了Configuration.mappingProvider()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.mappingProvider()
方法的具体详情如下:
包路径:com.jayway.jsonpath.Configuration
类名称:Configuration
方法名:mappingProvider
[英]Returns com.jayway.jsonpath.spi.mapper.MappingProvider used by this configuration
[中]返回com。乱穿马路。jsonpath。spi。制图员。此配置使用的映射提供程序
代码示例来源:origin: json-path/JsonPath
private <T> T convert(Object obj, Class<T> targetType, Configuration configuration) {
return configuration.mappingProvider().map(obj, targetType, configuration);
}
代码示例来源:origin: json-path/JsonPath
private <T> T convert(Object obj, TypeRef<T> targetType, Configuration configuration) {
return configuration.mappingProvider().map(obj, targetType, configuration);
}
代码示例来源:origin: json-path/JsonPath
@Override
public <T> T item(Class<T> clazz) throws MappingException {
return configuration().mappingProvider().map(contextDocument, clazz, configuration);
}
代码示例来源:origin: apache/geode
private void saveDefaults() {
try {
Configuration defaultConfiguration = Configuration.defaultConfiguration();
this.jsonProvider = defaultConfiguration.jsonProvider();
this.mappingProvider = defaultConfiguration.mappingProvider();
this.options = defaultConfiguration.getOptions();
this.hadDefaults = true;
} catch (NoClassDefFoundError ignore) {
this.hadDefaults = false;
}
}
代码示例来源:origin: json-path/JsonPath
else if (res instanceof Boolean) return ValueNode.createBooleanNode(res.toString());
else if (res == null) return NULL_NODE;
else if (ctx.configuration().jsonProvider().isArray(res)) return ValueNode.createJsonNode(ctx.configuration().mappingProvider().map(res, List.class, ctx.configuration()));
else if (ctx.configuration().jsonProvider().isMap(res)) return ValueNode.createJsonNode(ctx.configuration().mappingProvider().map(res, Map.class, ctx.configuration()));
else throw new JsonPathException("Could not convert " + res.toString() + " to a ValueNode");
} catch (PathNotFoundException e) {
代码示例来源:origin: com.jayway.jsonpath/json-path
private <T> T convert(Object obj, TypeRef<T> targetType, Configuration configuration){
return configuration.mappingProvider().map(obj, targetType, configuration);
}
代码示例来源:origin: com.jayway.jsonpath/json-path
private <T> T convert(Object obj, Class<T> targetType, Configuration configuration){
return configuration.mappingProvider().map(obj, targetType, configuration);
}
代码示例来源:origin: com.jayway.jsonpath/json-path
@Override
public <T> T item(Class<T> clazz) throws MappingException {
return configuration().mappingProvider().map(contextDocument, clazz, configuration);
}
代码示例来源:origin: line/centraldogma
@Override
public MappingProvider mappingProvider() {
return jsonPathCfg.mappingProvider();
}
});
代码示例来源:origin: com.github.lafa.jsonpath/json-path
private <T> T convert(Object obj, Class<T> targetType, Configuration configuration){
return configuration.mappingProvider().map(obj, targetType, configuration);
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
private <T> T convert(Object obj, TypeRef<T> targetType, Configuration configuration){
return configuration.mappingProvider().map(obj, targetType, configuration);
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
@Override
public <T> T item(Class<T> clazz) throws MappingException {
return configuration().mappingProvider().map(contextDocument, clazz, configuration);
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
else if (res instanceof Boolean) return ValueNode.createBooleanNode(res.toString());
else if (res == null) return ValueNode.NULL_NODE;
else if (ctx.configuration().jsonProvider().isArray(res)) return ValueNode.createJsonNode(ctx.configuration().mappingProvider().map(res, List.class, ctx.configuration()));
else if (ctx.configuration().jsonProvider().isMap(res)) return ValueNode.createJsonNode(ctx.configuration().mappingProvider().map(res, Map.class, ctx.configuration()));
else throw new JsonPathException("Could not convert " + res.toString() + " to a ValueNode");
} catch (PathNotFoundException e) {
代码示例来源:origin: batfish/batfish
public JsonPathTest() {
Configuration.setDefaults(BatfishJsonPathDefaults.INSTANCE);
ConfigurationBuilder b = new ConfigurationBuilder();
_baseConfiguration = b.build();
_oneNtpServerNodesAnswerStr =
CommonUtil.readResource("org/batfish/question/jsonpath/oneNtpServer.json");
_oneNtpServerNodesAnswerJsonObject =
JsonPath.parse(_oneNtpServerNodesAnswerStr, _baseConfiguration).json();
_twoNtpServersNodesAnswerStr =
CommonUtil.readResource("org/batfish/question/jsonpath/twoNtpServers.json");
_twoNtpServersNodesAnswerJsonObject =
JsonPath.parse(_twoNtpServersNodesAnswerStr, _baseConfiguration).json();
ConfigurationBuilder prefixCb = new ConfigurationBuilder();
prefixCb.mappingProvider(_baseConfiguration.mappingProvider());
prefixCb.jsonProvider(_baseConfiguration.jsonProvider());
prefixCb.evaluationListener(_baseConfiguration.getEvaluationListeners());
prefixCb.options(_baseConfiguration.getOptions());
prefixCb.options(Option.ALWAYS_RETURN_LIST);
prefixCb.options(Option.AS_PATH_LIST);
_prefixConfiguration = prefixCb.build();
}
内容来源于网络,如有侵权,请联系作者删除!