T - the value type produced by this listener@Beta public interface SchemaListener<T>
This is the main working part of a walking process. A SchemaWalker
will invoke a listener at various points in time when it walks a schema tree.
All methods can throw a ProcessingException if you choose to
abort processing due to an anomalous condition.
For one subtree, the order in which events are called are:
enteringPath(JsonPointer, ProcessingReport) (JsonPointer)}
(visiting a subtree);visiting(SchemaTree, ProcessingReport) (SchemaTree)};exitingPath(JsonPointer, ProcessingReport) (JsonPointer)}
(exiting a subtree).Note that in the event of ref resolution (using a ResolvingSchemaWalker), when visiting a tree, the visited tree is the
resulting tree of ref resolution, not the original tree.
For instance, if we consider this schema:
{
"type": "array",
"items": { "type": "string" }
}
for a listener listener, the order of events will be:
// Note: JSON Pointers used for both pointers and trees
listener.enteringPath("", report);
listener.visiting("", report);
listener.enteringPath("/items", report);
listener.visiting("/items", report);
listener.exitingPath("/items");
listener.exitingPath("");
| Modifier and Type | Method and Description |
|---|---|
void |
enteringPath(JsonPointer path,
ProcessingReport report)
Method called when entering a path in the schema
|
void |
exitingPath(JsonPointer path,
ProcessingReport report)
Method called when exiting a path in the schema
|
T |
getValue()
Return the value produced by this listener
|
void |
visiting(SchemaTree schemaTree,
ProcessingReport report)
Method called when visiting the tree at the current path
|
void enteringPath(JsonPointer path, ProcessingReport report) throws ProcessingException
path - the entered pathreport - the report to useProcessingException - processing failurevoid visiting(SchemaTree schemaTree, ProcessingReport report) throws ProcessingException
schemaTree - the visited treereport - the report to useProcessingException - processing failurevoid exitingPath(JsonPointer path, ProcessingReport report) throws ProcessingException
path - the exited pathreport - the report to useProcessingException - processing failureT getValue()