public class DefaultJsonBuilder extends Object implements JsonBuilder
| Constructor and Description |
|---|
DefaultJsonBuilder() |
DefaultJsonBuilder(String rootName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNodeBottomHalf(com.fasterxml.jackson.databind.node.JsonNodeType nodeType)
Adds the bottom half(a right brace/bracket) of a JSON
object/array to the JSON tree.
|
void |
addNodeTopHalf(String nodeName,
com.fasterxml.jackson.databind.node.JsonNodeType nodeType)
Adds a to half(a left brace/bracket and the field name) of a JSON
object/array to the JSON tree.
|
void |
addNodeWithSetTopHalf(String nodeName,
Set<String> sets)
Adds a child with list of values to JSON data tree.
|
void |
addNodeWithValueTopHalf(String nodeName,
String value)
Adds a child with value and a comma to the JSON tree.
|
void |
addValueToLeafListNode(String value)
Adds value to a leaf list node.
|
void |
finalizeJson(boolean isRootTypeMultiInstance)
Finalizes the output JSON and emits the JSON terminating symbol
(e.g., the right curly bracket).
|
com.fasterxml.jackson.databind.node.ObjectNode |
getTreeNode()
Returns the JSON tree after build operations in the format of string.
|
String |
getTreeString()
Returns the JSON tree after build operations in the format of string.
|
void |
initializeJson()
Initializes the output JSON and emits the JSON starting symbol
(e.g., the left curly bracket).
|
void |
popModuleName()
Removes the YANG module name of the JSON subtree that the builder
is currently building.
|
void |
pushModuleName(String moduleName)
Updates the YANG module name of the JSON subtree that the builder
is currently building.
|
String |
subTreeModuleName()
Returns the YANG module name of the JSON subtree that the builder
is currently building.
|
public DefaultJsonBuilder(String rootName)
public DefaultJsonBuilder()
public void addNodeTopHalf(String nodeName, com.fasterxml.jackson.databind.node.JsonNodeType nodeType)
JsonBuilderaddNodeTopHalf in interface JsonBuildernodeName - name of child to be addednodeType - the type of the childpublic void addNodeWithValueTopHalf(String nodeName, String value)
JsonBuilderaddNodeWithValueTopHalf in interface JsonBuildernodeName - name of child to be addedvalue - value of the child nodepublic void addNodeWithSetTopHalf(String nodeName, Set<String> sets)
JsonBuilderaddNodeWithSetTopHalf in interface JsonBuildernodeName - name of child to be addedsets - the value list of the childpublic void addValueToLeafListNode(String value)
JsonBuilderaddValueToLeafListNode in interface JsonBuildervalue - value to be addedpublic void addNodeBottomHalf(com.fasterxml.jackson.databind.node.JsonNodeType nodeType)
JsonBuilderaddNodeBottomHalf in interface JsonBuildernodeType - the type of the childpublic String getTreeString()
JsonBuildergetTreeString in interface JsonBuilderpublic com.fasterxml.jackson.databind.node.ObjectNode getTreeNode()
JsonBuildergetTreeNode in interface JsonBuilderpublic String subTreeModuleName()
JsonBuildersubTreeModuleName in interface JsonBuilderpublic void pushModuleName(String moduleName)
JsonBuilderpushModuleName in interface JsonBuildermoduleName - YANG module name of the current subtreepublic void popModuleName()
JsonBuilderpopModuleName in interface JsonBuilderpublic void initializeJson()
JsonBuilderinitializeJson in interface JsonBuilderpublic void finalizeJson(boolean isRootTypeMultiInstance)
JsonBuilderfinalizeJson in interface JsonBuilderisRootTypeMultiInstance - true if the root node of the JSON
tree has the multi-instance node typeCopyright © 2017. All rights reserved.