public interface JsonBuilder
| 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,
String valNamespace,
org.onosproject.yang.model.LeafType type)
Adds a child with value and a comma to the JSON tree.
|
void |
addValueToLeafListNode(String value,
String valNamespace,
org.onosproject.yang.model.LeafType type)
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.
|
void addNodeTopHalf(String nodeName, com.fasterxml.jackson.databind.node.JsonNodeType nodeType)
nodeName - name of child to be addednodeType - the type of the childvoid addNodeWithValueTopHalf(String nodeName, String value, String valNamespace, org.onosproject.yang.model.LeafType type)
nodeName - name of child to be addedvalue - value of the child nodevalNamespace - value namespacetype - leaf value typevoid addNodeWithSetTopHalf(String nodeName, Set<String> sets)
nodeName - name of child to be addedsets - the value list of the childvoid addValueToLeafListNode(String value, String valNamespace, org.onosproject.yang.model.LeafType type)
value - value to be addedvalNamespace - value namespacetype - leaf-list value typevoid addNodeBottomHalf(com.fasterxml.jackson.databind.node.JsonNodeType nodeType)
nodeType - the type of the childString getTreeString()
com.fasterxml.jackson.databind.node.ObjectNode getTreeNode()
String subTreeModuleName()
void pushModuleName(String moduleName)
moduleName - YANG module name of the current subtreevoid popModuleName()
void initializeJson()
void finalizeJson(boolean isRootTypeMultiInstance)
isRootTypeMultiInstance - true if the root node of the JSON
tree has the multi-instance node typeCopyright © 2019. All rights reserved.