@Immutable @ParametersAreNonnullByDefault public final class CanonicalSchemaTree extends BaseSchemaTree
SchemaTree using canonical dereferencing
In canonical dereferencing mode, a JSON Reference resolves within a schema if and only if the URI of the document and the base URI of the JSON Reference match exactly.
That is, x://y/z#/foo/bar resolves within the schema at URI
x://y/z#, but x://y/t# does not.
baseNode, key, pointer| Constructor and Description |
|---|
CanonicalSchemaTree(JsonNode baseNode)
Deprecated.
use
CanonicalSchemaTree(SchemaKey, JsonNode) instead |
CanonicalSchemaTree(JsonRef loadingRef,
JsonNode baseNode)
Deprecated.
|
CanonicalSchemaTree(SchemaKey key,
JsonNode baseNode)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
SchemaTree |
append(JsonPointer pointer)
Relocate the tree relatively to the current tree's pointer
|
boolean |
containsRef(JsonRef ref)
Tell whether a JSON Reference is contained within this schema tree
|
JsonPointer |
matchingPointer(JsonRef ref)
Return a matching pointer in this tree for a fully resolved reference
|
SchemaTree |
setPointer(JsonPointer pointer)
Relocate the tree with an absolute pointer
|
asJson, equals, getBaseNode, getContext, getDollarSchema, getId, getLoadingRef, getNode, getPointer, hashCode, idFromNode, resolve, toStringpublic CanonicalSchemaTree(SchemaKey key, JsonNode baseNode)
key - the schema keybaseNode - the base node@Deprecated public CanonicalSchemaTree(JsonNode baseNode)
CanonicalSchemaTree(SchemaKey, JsonNode) insteadbaseNode - the base node@Deprecated public CanonicalSchemaTree(JsonRef loadingRef, JsonNode baseNode)
public SchemaTree append(JsonPointer pointer)
SchemaTreepointer - the pointer to appendJsonPointer.append(JsonPointer)public SchemaTree setPointer(JsonPointer pointer)
SchemaTreepointer - the pointerpublic boolean containsRef(JsonRef ref)
SchemaTreeThis method will return true if the caller can attempt
to retrieve the JSON value addressed by this reference from the schema
tree directly.
Note that the reference must be fully resolved for this method to work.
ref - the target referenceSchemaTree.resolve(JsonRef)@Nullable public JsonPointer matchingPointer(JsonRef ref)
SchemaTreeThis must be called only when SchemaTree.containsRef(JsonRef)
returns true. Otherwise, its result is undefined.
ref - the referencenull if not found