|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.github.fge.jackson.jsonpointer.TreePointer<JsonNode> com.github.fge.jackson.jsonpointer.JsonPointer
@Immutable public final class JsonPointer
A 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.
Field Summary |
---|
Fields inherited from class com.github.fge.jackson.jsonpointer.TreePointer |
---|
BUNDLE, tokenResolvers |
Constructor Summary | |
---|---|
JsonPointer(List<TokenResolver<JsonNode>> tokenResolvers)
Alternate constructor |
|
JsonPointer(String input)
The main constructor |
Method Summary | |
---|---|
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 |
JsonPointer |
parent()
Return the immediate parent of this JSON Pointer |
Methods inherited from class com.github.fge.jackson.jsonpointer.TreePointer |
---|
equals, get, hashCode, isEmpty, iterator, path, tokensFromInput, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JsonPointer(String input) throws JsonPointerException
input
- the input string
JsonPointerException
- malformed JSON Pointer
NullPointerException
- null inputpublic JsonPointer(List<TokenResolver<JsonNode>> tokenResolvers)
This calls TreePointer.TreePointer(TreeNode, List)
with a
MissingNode
as the missing tree node.
tokenResolvers
- the list of token resolversMethod Detail |
---|
public 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 tokens
NullPointerException
- one input token is nullpublic JsonPointer append(String raw)
raw
- the raw token to append
NullPointerException
- input is nullpublic JsonPointer append(int index)
index
- the integer token to append
public JsonPointer append(JsonPointer other)
other
- the other pointer
NullPointerException
- other pointer is nullpublic JsonPointer parent()
The parent of the empty pointer is itself.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |