T - the value type produced by this listenerpublic 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:
onEnter(JsonPointer) (visiting a subtree);onTreeChange(SchemaTree, SchemaTree) (only if ResolvingSchemaWalker is used);onWalk(SchemaTree);onExit(JsonPointer) (exiting a subtree).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.onEnter("");
listener.onWalk("");
listener.onEnter("/items");
listener.onWalk("/items");
listener.onExit();
listener.onExit();
| Modifier and Type | Method and Description |
|---|---|
T |
getValue()
Return the value produced by this listener
|
void |
onEnter(JsonPointer pointer)
Method called when the walker changes pointer into the currently walked
tree
|
void |
onExit(JsonPointer pointer)
Method called when the walking process exits a subtree
|
void |
onTreeChange(SchemaTree oldTree,
SchemaTree newTree)
Method called when the walking process changes trees
|
void |
onWalk(SchemaTree tree)
Method called when the current tree node is walked
|
void onTreeChange(SchemaTree oldTree, SchemaTree newTree) throws ProcessingException
oldTree - the old treenewTree - the new treeProcessingException - processing failureResolvingSchemaWalkervoid onWalk(SchemaTree tree) throws ProcessingException
tree - the current treeProcessingException - processing failurevoid onEnter(JsonPointer pointer) throws ProcessingException
pointer - the relative pointer into the treeProcessingException - processing failurevoid onExit(JsonPointer pointer) throws ProcessingException
pointer - the relative pointer into the treeProcessingException - processing failureT getValue()
Copyright © 2013. All Rights Reserved.