public class JsonPointer extends Object
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<JsonPointer> |
__TYPE_ARG |
Constructor and Description |
---|
JsonPointer(JsonPointer delegate) |
JsonPointer(Object delegate) |
Modifier and Type | Method and Description |
---|---|
JsonPointer |
append(int index)
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> tokens)
Append an unescaped list of
tokens to JsonPointer Note: If you provide escaped paths the behaviour is undefined |
JsonPointer |
append(String token)
Append an unescaped
token to this pointer Note: If you provide escaped path the behaviour is undefined |
JsonPointer |
copy()
Copy a JsonPointer
|
static JsonPointer |
create()
Build an empty JsonPointer
|
boolean |
equals(Object o) |
static JsonPointer |
from(String pointer)
Build a JsonPointer from a json pointer string
|
static JsonPointer |
fromURI(URI uri)
Build a JsonPointer from a URI.
|
JsonPointer |
getDelegate() |
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 child)
Return
true if this pointer is a parent pointer of child . |
boolean |
isRootPointer()
Return
true if the pointer is a root pointer |
static JsonPointer |
newInstance(JsonPointer arg) |
JsonPointer |
parent()
Remove last reference token of this pointer
|
Object |
query(Object objectToQuery,
JsonPointerIterator iterator)
Query
objectToQuery using the provided JsonPointerIterator . |
Object |
queryJson(Object jsonElement)
Query
jsonElement . |
Object |
queryJsonOrDefault(Object jsonElement,
Object defaultValue)
Query
jsonElement . |
Object |
queryOrDefault(Object objectToQuery,
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 objectToWrite,
JsonPointerIterator iterator,
Object newElement,
boolean createOnMissing)
Write
newElement in objectToWrite using this pointer. |
Object |
writeJson(Object jsonElement,
Object newElement)
Write
newElement in jsonElement using this pointer. |
Object |
writeJson(Object jsonElement,
Object newElement,
boolean createOnMissing)
Write
newElement in jsonElement using this pointer. |
public static final io.vertx.lang.rx.TypeArg<JsonPointer> __TYPE_ARG
public JsonPointer(JsonPointer delegate)
public JsonPointer(Object delegate)
public JsonPointer getDelegate()
public boolean isRootPointer()
true
if the pointer is a root pointerpublic boolean isLocalPointer()
true
if the pointer is local (URI with only fragment)public boolean isParent(JsonPointer child)
true
if this pointer is a parent pointer of child
.
"/properties"
pointer is parent pointer of "/properties/parent"
child
- public String toString()
public JsonPointer append(String token)
token
to this pointer token
- the unescaped reference tokenpublic JsonPointer append(int index)
index
as reference token to JsonPointerindex
- public JsonPointer append(List<String> tokens)
tokens
to JsonPointer tokens
- unescaped reference tokenspublic JsonPointer append(JsonPointer pointer)
pointer
to this pointer pointer
- other pointerpublic JsonPointer parent()
public Object query(Object objectToQuery, JsonPointerIterator iterator)
objectToQuery
using the provided JsonPointerIterator
. queryJson(java.lang.Object)
objectToQuery
- the object to queryiterator
- the json pointer iterator that provides the logic to access to the objectToQuerypublic Object queryOrDefault(Object objectToQuery, JsonPointerIterator iterator, Object defaultValue)
objectToQuery
using the provided JsonPointerIterator
. If the query result is null, returns the default. queryJsonOrDefault(java.lang.Object, java.lang.Object)
objectToQuery
- the object to queryiterator
- the json pointer iterator that provides the logic to access to the objectToQuerydefaultValue
- default value if query result is nullpublic Object queryJson(Object jsonElement)
jsonElement
. jsonElement
- the json element to querypublic Object queryJsonOrDefault(Object jsonElement, Object defaultValue)
jsonElement
. If the query result is null, returns the default.jsonElement
- the json element to querydefaultValue
- default value if query result is nullpublic List<Object> tracedQuery(Object objectToQuery, JsonPointerIterator iterator)
objectToQuery
tracing each element walked during the query, including the first and the result (if any).objectToQuery
- the object to queryiterator
- the json pointer iterator that provides the logic to access to the objectToQuerypublic Object write(Object objectToWrite, JsonPointerIterator iterator, Object newElement, boolean createOnMissing)
newElement
in objectToWrite
using this pointer. The path token "-" is handled as append to end of array writeJson(java.lang.Object, java.lang.Object)
(Object)}objectToWrite
- 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 indexpublic Object writeJson(Object jsonElement, Object newElement)
newElement
in jsonElement
using this pointer. The path token "-" is handled as append to end of array.jsonElement
- json element to query and writenewElement
- json to insertpublic Object writeJson(Object jsonElement, Object newElement, boolean createOnMissing)
newElement
in jsonElement
using this pointer. The path token "-" is handled as append to end of array.jsonElement
- json to query and writenewElement
- json to insertcreateOnMissing
- create JsonObject when missing a object key or an array indexpublic JsonPointer copy()
public static JsonPointer create()
public static JsonPointer from(String pointer)
pointer
- the string representing a pointerpublic URI toURI()
public URI getURIWithoutFragment()
public static JsonPointer fromURI(URI uri)
uri
- uri representing a json pointerpublic static JsonPointer newInstance(JsonPointer arg)
Copyright © 2024 Eclipse. All rights reserved.