@Immutable public final class JsonPointer extends TreePointer<JsonNode>
TreePointer
for JsonNode
This is the "original" JSON Pointer in that it addresses JSON documents.
It also has a lot of utility methods covering several usage scenarios.
tokenResolvers
Constructor and Description |
---|
JsonPointer(String input)
The main constructor
|
Modifier and Type | Method and Description |
---|---|
JsonPointer |
append(int index)
Return a new pointer with a new integer token appended
|
JsonPointer |
append(JsonPointer other)
Return a new pointer with another pointer appended
|
JsonPointer |
append(String raw)
Return a new pointer with a new token appended
|
static JsonPointer |
empty()
Return an empty JSON Pointer
|
static JsonPointer |
of(Object first,
Object... other)
Build a JSON Pointer out of a series of reference tokens
|
equals, get, hashCode, isEmpty, iterator, path, tokensFromInput, toString
public JsonPointer(String input) throws JsonReferenceException
input
- the input stringJsonReferenceException
- malformed JSON PointerJsonReferenceError
- null inputpublic static JsonPointer empty()
public static JsonPointer of(Object first, Object... other)
These tokens can be everything; be sure however that they implement
Object.toString()
correctly!
Each of these tokens are treated as raw tokens (ie, not encoded).
first
- the first tokenother
- other tokensJsonReferenceError
- one input token is nullpublic JsonPointer append(String raw)
raw
- the raw token to appendJsonReferenceError
- input is nullpublic JsonPointer append(int index)
index
- the integer token to appendpublic JsonPointer append(JsonPointer other)
other
- the other pointerJsonReferenceError
- other pointer is nullCopyright © 2013. All Rights Reserved.