本文整理了Java中com.jayway.jsonpath.spi.json.JsonProvider.removeProperty()
方法的一些代码示例,展示了JsonProvider.removeProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonProvider.removeProperty()
方法的具体详情如下:
包路径:com.jayway.jsonpath.spi.json.JsonProvider
类名称:JsonProvider
方法名:removeProperty
[英]Removes a value in an object or array
[中]删除对象或数组中的值
代码示例来源:origin: json-path/JsonPath
public void delete(Configuration configuration){
for (String property : properties) {
configuration.jsonProvider().removeProperty(parent, property);
}
}
代码示例来源:origin: json-path/JsonPath
public void delete(Configuration configuration){
configuration.jsonProvider().removeProperty(parent, index);
}
代码示例来源:origin: json-path/JsonPath
public void delete(Configuration configuration){
configuration.jsonProvider().removeProperty(parent, property);
}
代码示例来源:origin: json-path/JsonPath
protected void renameInMap(Object targetMap, String oldKeyName, String newKeyName, Configuration configuration){
if(configuration.jsonProvider().isMap(targetMap)){
if(configuration.jsonProvider().getMapValue(targetMap, oldKeyName) == JsonProvider.UNDEFINED){
throw new PathNotFoundException("No results for Key "+oldKeyName+" found in map!");
}
configuration.jsonProvider().setProperty(targetMap, newKeyName, configuration.jsonProvider().getMapValue(targetMap, oldKeyName));
configuration.jsonProvider().removeProperty(targetMap, oldKeyName);
} else {
throw new InvalidModificationException("Can only rename properties in a map");
}
}
代码示例来源:origin: com.jayway.jsonpath/json-path
public void delete(Configuration configuration){
for (String property : properties) {
configuration.jsonProvider().removeProperty(parent, property);
}
}
代码示例来源:origin: com.jayway.jsonpath/json-path
public void delete(Configuration configuration){
configuration.jsonProvider().removeProperty(parent, index);
}
代码示例来源:origin: com.jayway.jsonpath/json-path
public void delete(Configuration configuration){
configuration.jsonProvider().removeProperty(parent, property);
}
代码示例来源:origin: com.jayway.jsonpath/json-path
protected void renameInMap(Object targetMap, String oldKeyName, String newKeyName, Configuration configuration){
if(configuration.jsonProvider().isMap(targetMap)){
if(configuration.jsonProvider().getMapValue(targetMap, oldKeyName) == JsonProvider.UNDEFINED){
throw new PathNotFoundException("No results for Key "+oldKeyName+" found in map!");
}
configuration.jsonProvider().setProperty(targetMap, newKeyName, configuration.jsonProvider().getMapValue(targetMap, oldKeyName));
configuration.jsonProvider().removeProperty(targetMap, oldKeyName);
} else {
throw new InvalidModificationException("Can only rename properties in a map");
}
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
public void delete(Configuration configuration){
for (String property : properties) {
configuration.jsonProvider().removeProperty(parent, property);
}
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
public void delete(Configuration configuration){
configuration.jsonProvider().removeProperty(parent, index);
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
public void delete(Configuration configuration){
configuration.jsonProvider().removeProperty(parent, property);
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
protected void renameInMap(Object targetMap, String oldKeyName, String newKeyName, Configuration configuration){
if(configuration.jsonProvider().isMap(targetMap)){
if(configuration.jsonProvider().getMapValue(targetMap, oldKeyName) == JsonProvider.UNDEFINED){
throw new PathNotFoundException("No results for Key "+oldKeyName+" found in map!");
}
configuration.jsonProvider().setProperty(targetMap, newKeyName, configuration.jsonProvider().getMapValue(targetMap, oldKeyName));
configuration.jsonProvider().removeProperty(targetMap, oldKeyName);
} else {
throw new InvalidModificationException("Can only rename properties in a map");
}
}
代码示例来源:origin: com.github.lafa.jsonpath/json-path
ctx.configuration().jsonProvider().removeProperty(old, new Integer(effectiveIndex));
} else if (ctx.configuration().jsonProvider().isArray(curr) && ctx.configuration().jsonProvider().length(curr) == 0) {
ctx.configuration().jsonProvider().removeProperty(old, new Integer(effectiveIndex));
代码示例来源:origin: com.github.lafa.jsonpath/json-path
ctx.configuration().jsonProvider().removeProperty(prev, property);
内容来源于网络,如有侵权,请联系作者删除!