public class JsonPointerImpl extends Object implements JsonPointer
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
VALID_POINTER_PATTERN |
| Modifier | Constructor and Description |
|---|---|
|
JsonPointerImpl() |
|
JsonPointerImpl(String pointer) |
|
JsonPointerImpl(URI uri) |
protected |
JsonPointerImpl(URI startingUri,
List<String> decodedTokens) |
| Modifier and Type | Method and Description |
|---|---|
JsonPointer |
append(int i)
Append the
index as reference token to JsonPointer |
JsonPointer |
append(JsonPointer pointer)
Append all tokens of
pointer to this pointer Note: The base URI of this pointer will remain untouched |
JsonPointer |
append(List<String> paths)
Append an unescaped list of
tokens to JsonPointer Note: If you provide escaped paths the behaviour is undefined |
JsonPointer |
append(String path)
Append an unescaped
token to this pointer Note: If you provide escaped path the behaviour is undefined |
JsonPointer |
copy()
Copy a JsonPointer
|
boolean |
equals(Object o) |
URI |
getURIWithoutFragment()
Return the underlying URI without the fragment
|
int |
hashCode() |
boolean |
isLocalPointer()
Return
true if the pointer is local (URI with only fragment) |
boolean |
isParent(JsonPointer c)
Return
true if this pointer is a parent pointer of child. |
boolean |
isRootPointer()
Return
true if the pointer is a root pointer |
JsonPointer |
parent()
Remove last reference token of this pointer
|
Object |
queryOrDefault(Object value,
JsonPointerIterator iterator,
Object defaultValue)
Query
objectToQuery using the provided JsonPointerIterator. |
String |
toString()
Build a string representation of the JSON Pointer
|
URI |
toURI()
Build a URI representation of the JSON Pointer
|
List<Object> |
tracedQuery(Object objectToQuery,
JsonPointerIterator iterator)
Query
objectToQuery tracing each element walked during the query, including the first and the result (if any).The first element of the list is objectToQuery and the last is the result, or the element before the first null was encountered |
Object |
write(Object valueToWrite,
JsonPointerIterator iterator,
Object newElement,
boolean createOnMissing)
Write
newElement in objectToWrite using this pointer. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreate, from, fromURI, query, queryJson, queryJsonOrDefault, writeJson, writeJsonpublic static final Pattern VALID_POINTER_PATTERN
public JsonPointerImpl(URI uri)
public JsonPointerImpl(String pointer)
public JsonPointerImpl()
public boolean isRootPointer()
JsonPointertrue if the pointer is a root pointerisRootPointer in interface JsonPointerpublic boolean isLocalPointer()
JsonPointertrue if the pointer is local (URI with only fragment)isLocalPointer in interface JsonPointerpublic boolean isParent(JsonPointer c)
JsonPointertrue if this pointer is a parent pointer of child.
"/properties" pointer is parent pointer of "/properties/parent"isParent in interface JsonPointerpublic String toString()
JsonPointertoString in interface JsonPointertoString in class Objectpublic URI toURI()
JsonPointertoURI in interface JsonPointerpublic URI getURIWithoutFragment()
JsonPointergetURIWithoutFragment in interface JsonPointerpublic JsonPointer append(String path)
JsonPointertoken to this pointer append in interface JsonPointerpath - the unescaped reference tokenpublic JsonPointer append(int i)
JsonPointerindex as reference token to JsonPointerappend in interface JsonPointerpublic JsonPointer append(List<String> paths)
JsonPointertokens to JsonPointer append in interface JsonPointerpaths - unescaped reference tokenspublic JsonPointer append(JsonPointer pointer)
JsonPointerpointer to this pointer append in interface JsonPointerpointer - other pointerpublic JsonPointer parent()
JsonPointerparent in interface JsonPointerpublic JsonPointer copy()
JsonPointercopy in interface JsonPointerpublic Object queryOrDefault(Object value, JsonPointerIterator iterator, Object defaultValue)
JsonPointerobjectToQuery using the provided JsonPointerIterator. If the query result is null, returns the default. JsonPointer.queryJsonOrDefault(Object, Object)queryOrDefault in interface JsonPointervalue - the object to queryiterator - the json pointer iterator that provides the logic to access to the objectToQuerydefaultValue - default value if query result is nullpublic List<Object> tracedQuery(Object objectToQuery, JsonPointerIterator iterator)
JsonPointerobjectToQuery tracing each element walked during the query, including the first and the result (if any).tracedQuery in interface JsonPointerobjectToQuery - the object to queryiterator - the json pointer iterator that provides the logic to access to the objectToQuerypublic Object write(Object valueToWrite, JsonPointerIterator iterator, Object newElement, boolean createOnMissing)
JsonPointernewElement in objectToWrite using this pointer. The path token "-" is handled as append to end of array JsonPointer.writeJson(Object, Object) (Object)}write in interface JsonPointervalueToWrite - object to writeiterator - the json pointer iterator that provides the logic to access to the objectToMutatenewElement - object to insertcreateOnMissing - create objects when missing a object key or an array indexCopyright © 2020. All rights reserved.