Package com.oorian.json
Class JsonParser
java.lang.Object
com.oorian.json.JsonParser
A lightweight JSON parser that converts JSON text into
JsonValue objects.
JsonParser is a simple recursive descent parser that handles all standard JSON data types: objects, arrays, strings, numbers, booleans, and null.
Each call to parse(String) creates a new parser instance, making it
safe for concurrent use from multiple threads.
For convenience, use JsonValue.parse(String),
JsonObject.parse(String), or JsonArray.parse(String) instead
of calling this class directly.
-
Method Summary
-
Method Details
-
parse
Parses a JSON string into the appropriateJsonValuesubtype.- Parameters:
text- the JSON string to parse.- Returns:
- the parsed JsonValue.
- Throws:
RuntimeException- if the JSON is malformed.
-