Interface NodeVisitor
- All Known Implementing Classes:
StringNodeVisitor
public interface NodeVisitor
A visitor of
Node
s.
This interface can be used through Node.accept(NodeVisitor)
.
-
Method Summary
Modifier and TypeMethodDescription@NotNull VisitResult
Ends visiting aListNode
.@NotNull VisitResult
Ends visiting aMapNode
.@NotNull VisitResult
Starts visiting aListNode
.@NotNull VisitResult
Starts visiting aMapNode
.@NotNull VisitResult
visit
(@NotNull BooleanArray array) Visits aBooleanArray
.@NotNull VisitResult
visit
(@NotNull BooleanValue value) Visits aBooleanValue
.@NotNull VisitResult
Visits aByteArray
.@NotNull VisitResult
Visits aByteValue
.@NotNull VisitResult
Visits aCharArray
.@NotNull VisitResult
Visits aCharValue
.@NotNull VisitResult
visit
(@NotNull CommentedNode<?> node) Visits aCommentedNode
.@NotNull VisitResult
visit
(@NotNull DoubleArray array) Visits aDoubleArray
.@NotNull VisitResult
visit
(@NotNull DoubleValue value) Visits aDoubleValue
.@NotNull VisitResult
Visits aEnumValue
.@NotNull VisitResult
visit
(@NotNull FloatArray array) Visits aFloatArray
.@NotNull VisitResult
visit
(@NotNull FloatValue value) Visits aFloatValue
.@NotNull VisitResult
Visits aIntArray
.@NotNull VisitResult
Visits aIntValue
.@NotNull VisitResult
Visits aLongArray
.@NotNull VisitResult
Visits aLongValue
.@NotNull VisitResult
Visits aNullNode
.@NotNull VisitResult
visit
(@NotNull ObjectNode<?> node) Visits aObjectNode
.@NotNull VisitResult
visit
(@NotNull ShortArray array) Visits aShortArray
.@NotNull VisitResult
visit
(@NotNull ShortValue value) Visits aShortValue
.@NotNull VisitResult
visit
(@NotNull StringValue value) Visits aStringValue
.@NotNull VisitResult
visitElement
(int index, @NotNull Node<?> node) VisitsListNode
's element.@NotNull VisitResult
visitEntry
(int num, @NotNull Object key, @NotNull Node<?> node) VisitsMapNode
's entry.
-
Method Details
-
visit
Visits aStringValue
.- Parameters:
value
- aStringValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aBooleanArray
.- Parameters:
array
- aBooleanArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aBooleanValue
.- Parameters:
value
- aBooleanValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aByteArray
.- Parameters:
array
- aByteArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aByteValue
.- Parameters:
value
- aByteValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aCharArray
.- Parameters:
array
- aCharArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aCharValue
.- Parameters:
value
- aCharValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aDoubleArray
.- Parameters:
array
- aDoubleArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aDoubleValue
.- Parameters:
value
- aDoubleValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aFloatArray
.- Parameters:
array
- aFloatArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aFloatValue
.- Parameters:
value
- aFloatValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aIntArray
.- Parameters:
array
- aIntArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aIntValue
.- Parameters:
value
- aIntValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aLongArray
.- Parameters:
array
- aLongArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aLongValue
.- Parameters:
value
- aLongValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aShortArray
.- Parameters:
array
- aShortArray
being visited- Returns:
- a
VisitResult
-
visit
Visits aShortValue
.- Parameters:
value
- aShortValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aEnumValue
.- Parameters:
value
- aEnumValue
being visited- Returns:
- a
VisitResult
-
visit
Visits aObjectNode
.- Parameters:
node
- aObjectNode
being visited- Returns:
- a
VisitResult
-
startList
Starts visiting aListNode
.If this method returns
VisitResult.SKIP
orVisitResult.STOP
,Node.accept(NodeVisitor)
will not visit its elements.- Parameters:
node
- aListNode
being 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
- aListNode
being visited- Returns:
- a
VisitResult
-
startMap
Starts visiting aMapNode
.If this method returns
VisitResult.SKIP
orVisitResult.STOP
,Node.accept(NodeVisitor)
will not visit its entries.- Parameters:
node
- aMapNode
being 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
- aMapNode
being 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
- aCommentedNode
being visited- Returns:
- a
VisitResult
-
visit
Visits aNullNode
.- Parameters:
node
- aNullNode
being visited- Returns:
- a
VisitResult
-