Class AbstractTraverser
- java.lang.Object
-
- io.apicurio.datamodels.models.visitors.AbstractTraverser
-
- Direct Known Subclasses:
AsyncApi20Traverser,AsyncApi21Traverser,AsyncApi22Traverser,AsyncApi23Traverser,AsyncApi24Traverser,AsyncApi25Traverser,AsyncApi26Traverser,AsyncApi30Traverser,OpenApi20Traverser,OpenApi30Traverser,OpenApi31Traverser
public abstract class AbstractTraverser extends Object implements Traverser, Visitor
Base class for all traversers.
-
-
Field Summary
Fields Modifier and Type Field Description protected TraversalContextImpltraversalContextprotected Visitorvisitor
-
Constructor Summary
Constructors Constructor Description AbstractTraverser(Visitor visitor)C'tor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoTraverseNode(Visitable node)Traverse the given node.voidtraverse(Node node)Called to traverse the data model starting at the given node and traversing down until this node and all child nodes have been visited.protected voidtraverseList(String propertyName, Collection<? extends Node> items)Traverse the items of the given array.protected voidtraverseMap(String propertyName, Map<String,? extends Node> items)Traverse the items of the given map.protected voidtraverseMappedNode(MappedNode<? extends Node> mappedNode)Traverse the items of the given mapped node.protected voidtraverseNode(String propertyName, Visitable node)Traverse into the given node, unless it's null.protected voidtraverseUnion(String propertyName, Union union)Traverse a union property.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.apicurio.datamodels.models.visitors.Visitor
visitContact, visitDocument, visitExternalDocumentation, visitInfo, visitLicense, visitOperation, visitParameter, visitSchema, visitSecurityScheme, visitTag
-
-
-
-
Field Detail
-
visitor
protected final Visitor visitor
-
traversalContext
protected final TraversalContextImpl traversalContext
-
-
Constructor Detail
-
AbstractTraverser
public AbstractTraverser(Visitor visitor)
C'tor.- Parameters:
visitor-
-
-
Method Detail
-
doTraverseNode
protected void doTraverseNode(Visitable node)
Traverse the given node. Guaranteed to not be null here.- Parameters:
node-
-
traverseNode
protected void traverseNode(String propertyName, Visitable node)
Traverse into the given node, unless it's null.- Parameters:
propertyName-node-
-
traverseList
protected void traverseList(String propertyName, Collection<? extends Node> items)
Traverse the items of the given array.- Parameters:
propertyName-items-
-
traverseMap
protected void traverseMap(String propertyName, Map<String,? extends Node> items)
Traverse the items of the given map.- Parameters:
propertyName-items-
-
traverseMappedNode
protected void traverseMappedNode(MappedNode<? extends Node> mappedNode)
Traverse the items of the given mapped node.- Parameters:
items-
-
traverseUnion
protected void traverseUnion(String propertyName, Union union)
Traverse a union property. Traversal of a union property only needs to happen if the value of the union is an entity or an entity collection.- Parameters:
propertyName-union-
-
-