Class StringNodeVisitor
java.lang.Object
dev.siroshun.configapi.core.node.visitor.StringNodeVisitor
- All Implemented Interfaces:
NodeVisitor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface to appends an object toStringBuilder.static final classA builder class ofStringNodeVisitor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendQuoteAndEscapedString(@NotNull String str, @NotNull StringBuilder builder) Appends the quoted/escapedStringtoStringBuilder.static StringNodeVisitor.Builderbuilder()Creates a newStringNodeVisitor.Builder.static @NotNull StringNodeVisitorcreate()Creates a newStringNodeVisitor.@NotNull VisitResultEnds visiting aListNode.@NotNull VisitResultEnds visiting aMapNode.@NotNull VisitResultStarts visiting aListNode.@NotNull VisitResultStarts visiting aMapNode.@NotNull StringtoString()Gets the result of string representation ofNodes.@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
-
appendQuoteAndEscapedString
public static void appendQuoteAndEscapedString(@NotNull @NotNull String str, @NotNull @NotNull StringBuilder builder) Appends the quoted/escapedStringtoStringBuilder.- Parameters:
str- theStringto appendbuilder- aStringBuilder
-
create
Creates a newStringNodeVisitor.- Returns:
- a new
StringNodeVisitor
-
builder
Creates a newStringNodeVisitor.Builder.- Returns:
- a new
StringNodeVisitor.Builder
-
visit
Description copied from interface:NodeVisitorVisits aStringValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aStringValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aBooleanArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aBooleanArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aBooleanValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aBooleanValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aByteArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aByteArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aByteValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aByteValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aCharArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aCharArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aCharValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aCharValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aDoubleArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aDoubleArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aDoubleValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aDoubleValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aFloatArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aFloatArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aFloatValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aFloatValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aIntArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aIntArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aIntValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aIntValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aLongArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aLongArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aLongValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aLongValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aShortArray.- Specified by:
visitin interfaceNodeVisitor- Parameters:
array- aShortArraybeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aShortValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aShortValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aEnumValue.- Specified by:
visitin interfaceNodeVisitor- Parameters:
value- aEnumValuebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aObjectNode.- Specified by:
visitin interfaceNodeVisitor- Parameters:
node- aObjectNodebeing visited- Returns:
- a
VisitResult
-
startList
Description copied from interface:NodeVisitorStarts visiting aListNode.If this method returns
VisitResult.SKIPorVisitResult.STOP,Node.accept(NodeVisitor)will not visit its elements.- Specified by:
startListin interfaceNodeVisitor- Parameters:
node- aListNodebeing visited- Returns:
- a
VisitResult
-
visitElement
Description copied from interface:NodeVisitorVisitsListNode's element.If this method returns:
VisitResult.CONTINUE- CallsNode.accept(NodeVisitor)of the elementVisitResult.BREAK- Stops visiting elements and callsNodeVisitor.endList(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
- Specified by:
visitElementin interfaceNodeVisitor- Parameters:
index- the index of the element in the listnode- the element- Returns:
- a
VisitResult
-
endList
Description copied from interface:NodeVisitorEnds visiting aListNode.- Specified by:
endListin interfaceNodeVisitor- Parameters:
node- aListNodebeing visited- Returns:
- a
VisitResult
-
startMap
Description copied from interface:NodeVisitorStarts visiting aMapNode.If this method returns
VisitResult.SKIPorVisitResult.STOP,Node.accept(NodeVisitor)will not visit its entries.- Specified by:
startMapin interfaceNodeVisitor- Parameters:
node- aMapNodebeing visited- Returns:
- a
VisitResult
-
visitEntry
@NotNull public @NotNull VisitResult visitEntry(int num, @NotNull @NotNull Object key, @NotNull @NotNull Node<?> node) Description copied from interface:NodeVisitorVisitsMapNode's entry.If this method returns:
VisitResult.CONTINUE- CallsNode.accept(NodeVisitor)of the entryVisitResult.BREAK- Stops visiting entries and callsNodeVisitor.endMap(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
- Specified by:
visitEntryin interfaceNodeVisitor- Parameters:
num- the number of the entry in the mapkey- the key of the entrynode- the value of the entry- Returns:
- a
VisitResult
-
endMap
Description copied from interface:NodeVisitorEnds visiting aMapNode.- Specified by:
endMapin interfaceNodeVisitor- Parameters:
node- aMapNodebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aCommentedNode.If this method returns
VisitResult.CONTINUE,CommentedNode.accept(NodeVisitor)will callNode.accept(NodeVisitor)ofCommentedNode.node()and returns its result.- Specified by:
visitin interfaceNodeVisitor- Parameters:
node- aCommentedNodebeing visited- Returns:
- a
VisitResult
-
visit
Description copied from interface:NodeVisitorVisits aNullNode.- Specified by:
visitin interfaceNodeVisitor- Parameters:
node- aNullNodebeing visited- Returns:
- a
VisitResult
-
toString
Gets the result of string representation ofNodes.
-