| 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) |
protected void |
deepGetObjects(Object currentObject,
List<Object> outValues) |
protected void |
deepGetPropertyValues(Object currentObject,
List<Object> outValues) |
protected void |
deepScan(Object currentObject,
String propertyName,
List<Object> results) |
protected void |
deepSet(Object currentObject,
String propertyName,
long propertyNameHash,
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) |
protected Object |
getArrayItem(Object currentObject,
int index) |
protected JavaBeanDeserializer |
getJavaBeanDeserializer(Class<?> currentClass) |
protected JavaBeanSerializer |
getJavaBeanSerializer(Class<?> currentClass) |
String |
getPath() |
protected Object |
getPropertyValue(Object currentObject,
String propertyName,
long propertyNameHash) |
protected Collection<Object> |
getPropertyValues(Object currentObject) |
protected void |
init() |
protected static boolean |
isDouble(Class<?> clazzA) |
protected static boolean |
isInt(Class<?> clazzA) |
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) |
protected boolean |
removePropertyValue(Object parent,
String name,
boolean deep) |
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) |
protected boolean |
setPropertyValue(Object parent,
String name,
long propertyNameHash,
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)
protected void init()
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)
protected Collection<Object> getPropertyValues(Object currentObject)
protected void deepGetPropertyValues(Object currentObject, List<Object> outValues)
protected static boolean isDouble(Class<?> clazzA)
protected static boolean isInt(Class<?> clazzA)
protected Object getPropertyValue(Object currentObject, String propertyName, long propertyNameHash)
protected void deepSet(Object currentObject, String propertyName, long propertyNameHash, Object value)
protected boolean setPropertyValue(Object parent, String name, long propertyNameHash, Object value)
protected JavaBeanSerializer getJavaBeanSerializer(Class<?> currentClass)
protected JavaBeanDeserializer getJavaBeanDeserializer(Class<?> currentClass)
public String toJSONString()
toJSONString in interface JSONAwareCopyright © 2023. All rights reserved.