public abstract class JsonFragment extends Object implements Comparable<JsonFragment>
In a JSON Reference, a fragment can only be a JSON Pointer. All other fragments are illegal.
The only possibility for a non JSON Pointer fragment to appear is when inline addressing mode is used.
IllegalFragment,
JsonPointer,
AddressingMode| Modifier and Type | Field and Description |
|---|---|
protected String |
asString
This fragment as a string value
|
| Modifier | Constructor and Description |
|---|---|
protected |
JsonFragment(String input)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(JsonFragment o) |
boolean |
equals(Object obj) |
static JsonFragment |
fromFragment(String fragment)
The only static factory method to obtain a fragment
|
int |
hashCode() |
boolean |
isEmpty()
Tell whether this fragment is empty
|
abstract JsonNode |
resolve(JsonNode node)
Resolve this fragment against a given node
|
String |
toString() |
protected final String asString
protected JsonFragment(String input)
input - the input fragmentpublic static JsonFragment fromFragment(String fragment)
Depending on the situation, this method will either return a
JsonPointer, an IllegalFragment or EMPTY.
fragment - the fragment as a stringpublic abstract JsonNode resolve(JsonNode node)
node - the nodeMissingNode if the fragment is not
found)public final boolean isEmpty()
EMPTYJsonRef.isAbsolute()public final int compareTo(JsonFragment o)
compareTo in interface Comparable<JsonFragment>Copyright © 2013. All Rights Reserved.