public abstract class BaseSchemaTree extends Object implements SchemaTree
JsonTree
carrying URI resolution context information
In addition to what JsonTree
does, this tree also modifies URI
resolution context information when changing paths, and adds methods in order
to query this resolution context.
All context information is carried as JSON References, since this is what is used for addressing in JSON Schema.
JsonRef
,
CanonicalSchemaTree
,
InlineSchemaTree
Modifier and Type | Field and Description |
---|---|
protected JsonNode |
baseNode
The initial node
|
protected JsonRef |
currentRef
The current resolution context
|
protected JsonRef |
loadingRef
The JSON Reference from which this node has been loaded
|
protected JsonNode |
node
The current node.
|
protected JsonPointer |
pointer
The current JSON Pointer into the node.
|
protected JsonRef |
startingRef
The JSON Reference representing the context at the root of the schema
|
protected boolean |
valid
Whether this schema is valid
|
Modifier | Constructor and Description |
---|---|
protected |
BaseSchemaTree(JsonRef loadingRef,
JsonNode baseNode,
Dereferencing dereferencing)
The main constructor
|
protected |
BaseSchemaTree(JsonRef loadingRef,
JsonNode baseNode,
JsonPointer pointer,
Dereferencing dereferencing,
boolean valid) |
Modifier and Type | Method and Description |
---|---|
JsonNode |
asJson() |
JsonNode |
getBaseNode()
Return the node this tree was created with
|
JsonRef |
getContext()
Get the current resolution context
|
JsonRef |
getLoadingRef()
Get the loading URI for that schema
|
JsonNode |
getNode()
Get the node at the current path
|
JsonPointer |
getPointer()
Get the current path into the document
|
protected static JsonRef |
idFromNode(JsonNode node)
Build a JSON Reference from a node
|
boolean |
isValid()
Tell whether this schema has been deemed valid by the syntax processor
|
JsonRef |
resolve(JsonRef other)
Resolve a JSON Reference against the current resolution context
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
append, containsRef, matchingPointer, setPointer, withValidationStatus
protected final boolean valid
protected final JsonNode baseNode
protected final JsonPointer pointer
protected final JsonNode node
protected final JsonRef loadingRef
If loaded without a URI, this will be the empty reference.
protected final JsonRef startingRef
It will defer from loadingRef
if there is an id
at
the top level.
protected final JsonRef currentRef
protected BaseSchemaTree(JsonRef loadingRef, JsonNode baseNode, Dereferencing dereferencing)
loadingRef
- the loading referencebaseNode
- the base nodeprotected BaseSchemaTree(JsonRef loadingRef, JsonNode baseNode, JsonPointer pointer, Dereferencing dereferencing, boolean valid)
public final JsonNode getBaseNode()
SimpleTree
Note: in current Jackson versions, this node is unfortunately mutable, so be careful...
getBaseNode
in interface SimpleTree
public final JsonPointer getPointer()
SimpleTree
getPointer
in interface SimpleTree
public final JsonNode getNode()
SimpleTree
getNode
in interface SimpleTree
MissingNode
if there is no matching
node at that pointer)public final JsonRef resolve(JsonRef other)
resolve
in interface SchemaTree
other
- the JSON Reference to resolveJsonRef.resolve(JsonRef)
public final JsonRef getLoadingRef()
getLoadingRef
in interface SchemaTree
JsonRef
public final JsonRef getContext()
getContext
in interface SchemaTree
JsonRef
public final boolean isValid()
SchemaTree
isValid
in interface SchemaTree
protected static JsonRef idFromNode(JsonNode node)
This will return null
if the reference could not be built. The
conditions for a successful build are as follows:
id
;node
- the nodenull
Copyright © 2013. All Rights Reserved.