Package manifold.json.rt
Class Json
- java.lang.Object
-
- manifold.json.rt.Json
-
public class Json extends Object
-
-
Constructor Summary
Constructors Constructor Description Json()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringBuilderappendValue(StringBuilder sb, Object comp)static ObjectfromJson(String json)Parse the JSON string as a manifold.rt.api.Bindings instance.static ObjectfromJson(String json, boolean withBigNumbers, boolean withTokens)static StringgetParserName()static voidindent(StringBuilder sb, int indent)static StringlistToJson(Iterable list)Serializes a JSON-compatible List into a JSON formatted StringBuilder with the specified indent of spacesstatic voidlistToJson(StringBuilder sb, int indent, Iterable value)static voidsetParserName(String fqn)static ObjecttoBindings(Object value)static StringtoJson(Object value)Build a JSON string from the specifiedvalue.static voidtoJson(StringBuilder target, int margin, Object value)Build a JSON string in the specifiedtargetfrom the specifiedvaluewith the provided leftmargin.static StringtoJson(Map thisMap)Serializes this Map instance to a JSON formatted Stringstatic voidtoJson(Map thisMap, StringBuilder sb, int indent)Serializes this Map instance into a JSON formatted StringBuilder with the specified indent of spaces
-
-
-
Method Detail
-
getParserName
public static String getParserName()
-
setParserName
public static void setParserName(String fqn)
-
toJson
public static String toJson(Map thisMap)
Serializes this Map instance to a JSON formatted String
-
toJson
public static void toJson(Map thisMap, StringBuilder sb, int indent)
Serializes this Map instance into a JSON formatted StringBuilder with the specified indent of spaces
-
indent
public static void indent(StringBuilder sb, int indent)
-
appendValue
public static StringBuilder appendValue(StringBuilder sb, Object comp)
-
toJson
public static String toJson(Object value)
Build a JSON string from the specifiedvalue. Thevaluemust be a valid JSON value:- primitive, boxed primitive, or
StringIterableof JSON valuesMapof JSON values- Returns:
- A JSON String reflecting the specified
value
- primitive, boxed primitive, or
-
toJson
public static void toJson(StringBuilder target, int margin, Object value)
Build a JSON string in the specifiedtargetfrom the specifiedvaluewith the provided leftmargin. Thevaluemust be a valid JSON value:- primitive, boxed primitive, or
StringIterableof JSON valuesMapof JSON values - primitive, boxed primitive, or
-
listToJson
public static void listToJson(StringBuilder sb, int indent, Iterable value)
-
listToJson
public static String listToJson(Iterable list)
Serializes a JSON-compatible List into a JSON formatted StringBuilder with the specified indent of spaces
-
fromJson
public static Object fromJson(String json)
Parse the JSON string as a manifold.rt.api.Bindings instance.- Parameters:
json- A Standard JSON formatted string- Returns:
- A JSON value (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)
-
-