Modifier and Type | Class and Description |
---|---|
static class |
JSONPath.FilterSegment |
Constructor and Description |
---|
JSONPath(String path) |
JSONPath(String path,
boolean ignoreNullValue) |
JSONPath(String path,
SerializeConfig serializeConfig,
ParserConfig parserConfig,
boolean ignoreNullValue) |
Modifier and Type | Method and Description |
---|---|
void |
arrayAdd(Object rootObject,
Object... values) |
static void |
arrayAdd(Object rootObject,
String path,
Object... values) |
static JSONPath |
compile(String path) |
static JSONPath |
compile(String path,
boolean ignoreNullValue) |
boolean |
contains(Object rootObject) |
static boolean |
contains(Object rootObject,
String path) |
boolean |
containsValue(Object rootObject,
Object value) |
static boolean |
containsValue(Object rootObject,
String path,
Object value) |
Object |
eval(Object rootObject) |
static Object |
eval(Object rootObject,
String path) |
static Object |
eval(Object rootObject,
String path,
boolean ignoreNullValue) |
<T> T |
eval(Object rootObject,
Type clazz) |
<T> T |
eval(Object rootObject,
Type clazz,
ParserConfig parserConfig) |
Object |
extract(DefaultJSONParser parser) |
static Object |
extract(String json,
String path) |
static Object |
extract(String json,
String path,
ParserConfig config,
int features,
Feature... optionFeatures) |
String |
getPath() |
boolean |
isRef() |
Set<?> |
keySet(Object rootObject)
Extract keySet or field names from rootObject on this JSONPath.
|
static Set<?> |
keySet(Object rootObject,
String path)
Compile jsonPath and use it to extract keySet or field names from rootObject.
|
void |
patchAdd(Object rootObject,
Object value,
boolean replace) |
static Map<String,Object> |
paths(Object javaObject) |
static Map<String,Object> |
paths(Object javaObject,
SerializeConfig config) |
static Object |
read(String json,
String path) |
static <T> T |
read(String json,
String path,
Type clazz) |
static <T> T |
read(String json,
String path,
Type clazz,
ParserConfig parserConfig) |
boolean |
remove(Object rootObject) |
static boolean |
remove(Object root,
String path) |
boolean |
removeArrayItem(JSONPath path,
Object currentObject,
int index) |
static Object |
reserveToArray(Object object,
String... paths) |
static Object |
reserveToObject(Object object,
String... paths) |
boolean |
set(Object rootObject,
Object value) |
boolean |
set(Object rootObject,
Object value,
boolean p) |
static boolean |
set(Object rootObject,
String path,
Object value) |
boolean |
setArrayItem(JSONPath path,
Object currentObject,
int index,
Object value) |
int |
size(Object rootObject) |
static int |
size(Object rootObject,
String path) |
String |
toJSONString() |
public JSONPath(String path)
public JSONPath(String path, boolean ignoreNullValue)
public JSONPath(String path, SerializeConfig serializeConfig, ParserConfig parserConfig, boolean ignoreNullValue)
public boolean isRef()
public <T> T eval(Object rootObject, Type clazz, ParserConfig parserConfig)
rootObject
- clazz
- parserConfig
- public <T> T eval(Object rootObject, Type clazz)
rootObject
- clazz
- public Object extract(DefaultJSONParser parser)
public boolean contains(Object rootObject)
public int size(Object rootObject)
public Set<?> keySet(Object rootObject)
rootObject
- Can be a map or custom object. Array and Collection are not supported.null
if not supported.public boolean remove(Object rootObject)
public static Set<?> keySet(Object rootObject, String path)
rootObject
- Can be a map or custom object. Array and Collection are not supported.path
- JSONPath string to be compiled.null
if not supported.public static Object read(String json, String path)
json
- path
- public static <T> T read(String json, String path, Type clazz, ParserConfig parserConfig)
json
- path
- clazz
- parserConfig
- public static <T> T read(String json, String path, Type clazz)
json
- path
- clazz
- public static Object extract(String json, String path, ParserConfig config, int features, Feature... optionFeatures)
json
- path
- public static Map<String,Object> paths(Object javaObject, SerializeConfig config)
public String getPath()
public boolean setArrayItem(JSONPath path, Object currentObject, int index, Object value)
public String toJSONString()
toJSONString
in interface JSONAware
Copyright © 2012–2022 Alibaba Group. All rights reserved.