Package net.diversionmc.json
Class JSON
java.lang.Object
net.diversionmc.json.JSON
Simple
Parser example which parses JSON files into JSON.JSONValue objects.- Author:
- Kirill Semyonkin - Diversion Network 2021
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParsed JSON array that stores a list ofJSON.JSONValue.static classParsed JSON number, as a double value.static classParsed JSON object that stores key-JSON.JSONValuepairs.static classParsed JSON string, or stored values true, false or null.static classParsed JSON value that stores any data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JSON.JSONValueConvert an arbitrary object into JSON.static JSON.JSONValueConvert a string into a JSONValue.
-
Constructor Details
-
JSON
public JSON()
-
-
Method Details
-
from
Convert an arbitrary object into JSON. It has to be aMap,Collection,String, null, true, false or a number.- Parameters:
object- Object to serialize.- Returns:
- Serialized object.
-
parse
Convert a string into a JSONValue.- Parameters:
text- String to parse.- Returns:
- Parsed JSON storage.
-