public interface JsonPointer
This class is an immutable representation of a JSON Pointer as specified in RFC 6901.
JSON Pointer is a string syntax for identifying a specific value within a JavaScript Object Notation (JSON) document [RFC4627]. JSON Pointer is intended to be easily expressed in JSON string values as well as Uniform Resource Identifier (URI) [RFC3986] fragment identifiers.
The method getValue() returns the referenced value.
The methods add(), replace(),
and remove() executes the operations specified in
RFC 6902.
| Modifier and Type | Method and Description |
|---|---|
<T extends JsonStructure> |
add(T target,
JsonValue newValue)
Add or replace the value at the position referenced by this JsonPointer with
the new value
|
boolean |
containsValue(JsonStructure target)
Verify if the target JSON structure contains a value at the referenced location.
|
JsonValue |
getValue(JsonStructure target)
Get the JsonValue at the position referenced by this JsonPointer.
|
<T extends JsonStructure> |
remove(T target)
Remove the value from the referenced position inside the target JSON.
|
<T extends JsonStructure> |
replace(T target,
JsonValue newValue)
Replace the value at the position referenced by this JsonPointer with
the newValue.
|
JsonValue getValue(JsonStructure target)
target - the JSON to apply this JsonPointer onJsonException - if no value exists at the referenced locationNullPointerException - if the target is null<T extends JsonStructure> T add(T target, JsonValue newValue)
T - target - structure in which the newValue should be added or replacednewValue - the new value to setJsonException - if no value exists at the referenced locationNullPointerException - if the target is null<T extends JsonStructure> T remove(T target)
T - the type of the passed JsonStructuretarget - to remove the value fromJsonException - if no value exists at the referenced locationNullPointerException - if the target is null<T extends JsonStructure> T replace(T target, JsonValue newValue)
T - target - structure in which the newValue should be replacednewValue - the new value to setJsonException - if no value exists at the referenced locationNullPointerException - if the target is nullboolean containsValue(JsonStructure target)
target - to checktrue if there is a value at the referenced location, false otherwiseNullPointerException - if the target is nullCopyright © 2010 - 2020 Adobe. All Rights Reserved