@Immutable public final class JsonPointer extends TreePointer<com.fasterxml.jackson.databind.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.
BUNDLE, tokenResolvers
Constructor and Description |
---|
JsonPointer(java.util.List<TokenResolver<com.fasterxml.jackson.databind.JsonNode>> tokenResolvers)
Alternate constructor
|
JsonPointer(java.lang.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(java.lang.String raw)
Return a new pointer with a new token appended
|
static JsonPointer |
empty()
Return an empty JSON Pointer
|
static JsonPointer |
of(java.lang.Object first,
java.lang.Object... other)
Build a JSON Pointer out of a series of reference tokens
|
JsonPointer |
parent()
Return the immediate parent of this JSON Pointer
|
equals, get, hashCode, isEmpty, iterator, path, tokensFromInput, toString
public JsonPointer(java.lang.String input) throws JsonPointerException
input
- the input stringJsonPointerException
- malformed JSON Pointerjava.lang.NullPointerException
- null inputpublic JsonPointer(java.util.List<TokenResolver<com.fasterxml.jackson.databind.JsonNode>> tokenResolvers)
This calls TreePointer.TreePointer(TreeNode, List)
with a
MissingNode
as the missing tree node.
tokenResolvers
- the list of token resolverspublic static JsonPointer empty()
public static JsonPointer of(java.lang.Object first, java.lang.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 tokensjava.lang.NullPointerException
- one input token is nullpublic JsonPointer append(java.lang.String raw)
raw
- the raw token to appendjava.lang.NullPointerException
- input is nullpublic JsonPointer append(int index)
index
- the integer token to appendpublic JsonPointer append(JsonPointer other)
other
- the other pointerjava.lang.NullPointerException
- other pointer is nullpublic JsonPointer parent()
The parent of the empty pointer is itself.