public abstract class JsonFragment extends Object
In a JSON Reference, a fragment can either be a JSON Pointer or a schema id. In both cases, when found, the fragment must be resolve with regards to the schema. This is what this class, and its two implementations, are for.
IdFragment,
JsonPointer| Modifier and Type | Field and Description |
|---|---|
private static JsonFragment |
EMPTY
Special case fragment (empty)
|
| Constructor and Description |
|---|
JsonFragment() |
| Modifier and Type | Method and Description |
|---|---|
static JsonFragment |
fromFragment(String fragment)
The only static factory method to obtain a fragment
|
boolean |
isEmpty()
Tell whether this fragment is empty
|
abstract JsonNode |
resolve(JsonNode node)
Resolve this fragment against a given node
|
abstract String |
toString() |
private static final JsonFragment EMPTY
public static JsonFragment fromFragment(String fragment)
Depending on the situation, this method will either return a
JsonPointer, an IdFragment 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()Copyright © 2012. All Rights Reserved.