Package org.apache.calcite.util
Class JsonBuilder
java.lang.Object
org.apache.calcite.util.JsonBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(StringBuilder buf, int indent, @Nullable Object o) Appends a JSON object to a string builder.list()
Creates a JSON object (represented by aList
).map()
Creates a JSON object (represented by aMap
).Adds a key/value pair to a JSON object.Adds a key/value pair to a JSON object if the value is not null.Serializes an object consisting of maps, lists and atoms into a JSON string.
-
Constructor Details
-
JsonBuilder
public JsonBuilder()
-
-
Method Details
-
map
Creates a JSON object (represented by aMap
). -
list
Creates a JSON object (represented by aList
). -
put
Adds a key/value pair to a JSON object. -
putIf
Adds a key/value pair to a JSON object if the value is not null. -
toJsonString
Serializes an object consisting of maps, lists and atoms into a JSON string.We should use a JSON library such as Jackson when Mondrian needs one elsewhere.
-
append
Appends a JSON object to a string builder.
-