Class JSONPathWrapper
- java.lang.Object
-
- org.gcube.application.geoportal.common.model.JSONPathWrapper
-
public class JSONPathWrapper extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static com.jayway.jsonpath.ConfigurationJSON_PATH_ALWAYS_LIST_CONFIGBased on https://github.com/json-path/JsonPathstatic com.jayway.jsonpath.ConfigurationJSON_PATH_PATHS_CONFIGURATION
-
Constructor Summary
Constructors Constructor Description JSONPathWrapper(String json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSONPathWrapperaddElementToArray(String path, Object toAdd)Appends a new element @toSet as child of all arrays matching @pathList<Object>getByPath(String path)<T> List<T>getByPath(String path, Class<T> clazz)List<String>getMatchingPaths(String path)JSONPathWrapperputElement(String path, String elementName, Object toSet)Creates a new element @elementName == @toSet as child of all matching @pathJSONPathWrappersetElement(String path, Object toSet)Changes the value of an existent field at @path
-
-
-
Constructor Detail
-
JSONPathWrapper
public JSONPathWrapper(String json)
-
-
Method Detail
-
setElement
public JSONPathWrapper setElement(String path, Object toSet)
Changes the value of an existent field at @path- Parameters:
path-toSet-- Returns:
-
putElement
public JSONPathWrapper putElement(String path, String elementName, Object toSet)
Creates a new element @elementName == @toSet as child of all matching @path- Parameters:
path-elementName-toSet-- Returns:
-
addElementToArray
public JSONPathWrapper addElementToArray(String path, Object toAdd)
Appends a new element @toSet as child of all arrays matching @path- Parameters:
path-toAdd-- Returns:
-
-