public abstract class SchemaWalker extends Object
This class walks a JSON Schema (in the shape of a SchemaTree
recursively. In order to visit subschemas, it relies on a series of PointerCollector instances (provided by a dictionary) to get the knowledge
of what schemas to visit next.
Only subschemas are visited: unknown keywords, or keywords not having any subschemas, are ignored.
Important: the initial schema must be syntactically valid.
SimpleSchemaWalker,
ResolvingSchemaWalker| Modifier and Type | Field and Description |
|---|---|
protected SchemaTree |
tree
The current schema tree being walked
|
| Modifier | Constructor and Description |
|---|---|
protected |
SchemaWalker(SchemaTree tree,
SchemaWalkingConfiguration cfg) |
| Modifier and Type | Method and Description |
|---|---|
abstract <T> void |
resolveTree(SchemaListener<T> listener,
ProcessingReport report)
Change the current tree to another tree, if any
|
abstract String |
toString() |
<T> void |
walk(SchemaListener<T> listener,
ProcessingReport report)
Walk a tree with a listener
|
protected SchemaTree tree
protected SchemaWalker(SchemaTree tree, SchemaWalkingConfiguration cfg)
public final <T> void walk(SchemaListener<T> listener, ProcessingReport report) throws ProcessingException
T - the value type produced by the listenerlistener - the listenerreport - the processing report to useProcessingException - processing failurepublic abstract <T> void resolveTree(SchemaListener<T> listener, ProcessingReport report) throws ProcessingException
T - type of value produced by the listenerlistener - the listenerreport - the reportProcessingException - processing failureResolvingSchemaWalkerCopyright © 2013. All Rights Reserved.