public final class InlineSchemaTree extends JsonSchemaTree
JsonSchemaTree
using inline dereferencing
When using inline dereferencing, a (fully resolved) reference is contained within the tree if it is relative to one of the URI resolution contexts in this tree, or to the loading URI itself.
And this makes things quite hairy to handle. Consider, for instance, that
foo://bar#/a/b/c
is contained within such a tree if the tree has a
resolution context with URI foo://bar#/a/b
!
This implementaiton correctly handles this kind of corner cases. For resolution contexts whose fragment part is not a JSON Pointer, an exact reference equality is required.
currentRef, loadingRef, refStack, startingRef
baseNode, currentNode, currentPointer, FACTORY, nodeStack, pointerStack
Constructor and Description |
---|
InlineSchemaTree(JsonNode baseNode) |
InlineSchemaTree(JsonRef loadingRef,
JsonNode baseNode) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsRef(JsonRef ref)
Tell whether a full resolved reference is contained within this tree
|
JsonPointer |
matchingPointer(JsonRef ref)
Return a matching pointer in this tree for a fully resolved reference
|
append, asJson, copy, equals, getCurrentRef, getLoadingRef, hashCode, idFromNode, pop, resolve, setPointer, toString
getCurrentNode, getCurrentPointer, popNode, popPointer, pushNode, pushPointer
public InlineSchemaTree(JsonNode baseNode)
public boolean containsRef(JsonRef ref)
Given the pecularity of inline dereferencing, this operation is not as simple as for canonical trees. The algorithm is as follows:
true
if and only if an exact match is found,
false
otherwise;false
;true
if the JSON Pointer of the
matched context is a parent of the ref's JSON Pointer.containsRef
in class JsonSchemaTree
ref
- the target referenceJsonPointer.isParentOf(JsonPointer)
public JsonPointer matchingPointer(JsonRef ref)
JsonSchemaTree
This must be called only when JsonSchemaTree.containsRef(JsonRef)
returns true
. Otherwise, its result is undefined.
matchingPointer
in class JsonSchemaTree
ref
- the referencenull
if not foundCopyright © 2013. All Rights Reserved.