Interface NodeVisitor
- All Known Implementing Classes:
StringNodeVisitor
public interface NodeVisitor
A visitor of
Nodes.
This interface can be used through Node.accept(NodeVisitor).
-
Method Summary
Modifier and TypeMethodDescription@NotNull VisitResultEnds visiting aListNode.@NotNull VisitResultEnds visiting aMapNode.@NotNull VisitResultStarts visiting aListNode.@NotNull VisitResultStarts visiting aMapNode.@NotNull VisitResultvisit(@NotNull BooleanArray array) Visits aBooleanArray.@NotNull VisitResultvisit(@NotNull BooleanValue value) Visits aBooleanValue.@NotNull VisitResultVisits aByteArray.@NotNull VisitResultVisits aByteValue.@NotNull VisitResultVisits aCharArray.@NotNull VisitResultVisits aCharValue.@NotNull VisitResultvisit(@NotNull CommentedNode<?> node) Visits aCommentedNode.@NotNull VisitResultvisit(@NotNull DoubleArray array) Visits aDoubleArray.@NotNull VisitResultvisit(@NotNull DoubleValue value) Visits aDoubleValue.@NotNull VisitResultVisits aEnumValue.@NotNull VisitResultvisit(@NotNull FloatArray array) Visits aFloatArray.@NotNull VisitResultvisit(@NotNull FloatValue value) Visits aFloatValue.@NotNull VisitResultVisits aIntArray.@NotNull VisitResultVisits aIntValue.@NotNull VisitResultVisits aLongArray.@NotNull VisitResultVisits aLongValue.@NotNull VisitResultVisits aNullNode.@NotNull VisitResultvisit(@NotNull ObjectNode<?> node) Visits aObjectNode.@NotNull VisitResultvisit(@NotNull ShortArray array) Visits aShortArray.@NotNull VisitResultvisit(@NotNull ShortValue value) Visits aShortValue.@NotNull VisitResultvisit(@NotNull StringValue value) Visits aStringValue.@NotNull VisitResultvisitElement(int index, @NotNull Node<?> node) VisitsListNode's element.@NotNull VisitResultvisitEntry(int num, @NotNull Object key, @NotNull Node<?> node) VisitsMapNode's entry.
-
Method Details
-
visit
Visits aStringValue.- Parameters:
value- aStringValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aBooleanArray.- Parameters:
array- aBooleanArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aBooleanValue.- Parameters:
value- aBooleanValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aByteArray.- Parameters:
array- aByteArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aByteValue.- Parameters:
value- aByteValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aCharArray.- Parameters:
array- aCharArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aCharValue.- Parameters:
value- aCharValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aDoubleArray.- Parameters:
array- aDoubleArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aDoubleValue.- Parameters:
value- aDoubleValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aFloatArray.- Parameters:
array- aFloatArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aFloatValue.- Parameters:
value- aFloatValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aIntArray.- Parameters:
array- aIntArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aIntValue.- Parameters:
value- aIntValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aLongArray.- Parameters:
array- aLongArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aLongValue.- Parameters:
value- aLongValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aShortArray.- Parameters:
array- aShortArraybeing visited- Returns:
- a
VisitResult
-
visit
Visits aShortValue.- Parameters:
value- aShortValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aEnumValue.- Parameters:
value- aEnumValuebeing visited- Returns:
- a
VisitResult
-
visit
Visits aObjectNode.- Parameters:
node- aObjectNodebeing visited- Returns:
- a
VisitResult
-
startList
Starts visiting aListNode.If this method returns
VisitResult.SKIPorVisitResult.STOP,Node.accept(NodeVisitor)will not visit its elements.- Parameters:
node- aListNodebeing visited- Returns:
- a
VisitResult
-
visitElement
VisitsListNode's element.If this method returns:
VisitResult.CONTINUE- CallsNode.accept(NodeVisitor)of the elementVisitResult.BREAK- Stops visiting elements and callsendList(ListNode)VisitResult.SKIP- Skips the element (Node.accept(NodeVisitor)of the element will not be called)VisitResult.STOP- Stop visiting immediately andNode.accept(NodeVisitor)will returnsVisitResult.STOP
- Parameters:
index- the index of the element in the listnode- the element- Returns:
- a
VisitResult
-
endList
Ends visiting aListNode.- Parameters:
node- aListNodebeing visited- Returns:
- a
VisitResult
-
startMap
Starts visiting aMapNode.If this method returns
VisitResult.SKIPorVisitResult.STOP,Node.accept(NodeVisitor)will not visit its entries.- Parameters:
node- aMapNodebeing visited- Returns:
- a
VisitResult
-
visitEntry
@NotNull @NotNull VisitResult visitEntry(int num, @NotNull @NotNull Object key, @NotNull @NotNull Node<?> node) VisitsMapNode's entry.If this method returns:
VisitResult.CONTINUE- CallsNode.accept(NodeVisitor)of the entryVisitResult.BREAK- Stops visiting entries and callsendMap(MapNode)VisitResult.SKIP- Skips the entry (Node.accept(NodeVisitor)of the entry will not be called)VisitResult.STOP- Stop visiting immediately andNode.accept(NodeVisitor)will returnsVisitResult.STOP
- Parameters:
num- the number of the entry in the mapkey- the key of the entrynode- the value of the entry- Returns:
- a
VisitResult
-
endMap
Ends visiting aMapNode.- Parameters:
node- aMapNodebeing visited- Returns:
- a
VisitResult
-
visit
Visits aCommentedNode.If this method returns
VisitResult.CONTINUE,CommentedNode.accept(NodeVisitor)will callNode.accept(NodeVisitor)ofCommentedNode.node()and returns its result.- Parameters:
node- aCommentedNodebeing visited- Returns:
- a
VisitResult
-
visit
Visits aNullNode.- Parameters:
node- aNullNodebeing visited- Returns:
- a
VisitResult
-