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() |
abstract boolean |
isEmpty()
Tell whether this fragment is empty
|
abstract boolean |
isPointer()
Tell whether this fragment is a valid JSON Pointer
|
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
or an IllegalFragment
.
fragment
- the fragment as a stringpublic abstract JsonNode resolve(JsonNode node)
node
- the nodeMissingNode
if the fragment is not
found)public abstract boolean isEmpty()
JsonRef.isAbsolute()
public abstract boolean isPointer()
JsonPointer
public final int compareTo(JsonFragment o)
compareTo
in interface Comparable<JsonFragment>
Copyright © 2013. All Rights Reserved.