Package javajs.util
Class JSJSONParser
java.lang.Object
javajs.util.JSJSONParser
a very simple JSON parser for JSON objects that are compatible with JavaScript
A gross simplification of https://github.com/douglascrockford/JSON-java
A SUBSET of JSON with similarly to window.JSON.parse():
In JavaScript returns "null" for a null value, not null
-- requires quoted strings for keys and values
-- does not allow /xxx/ objects
- Author:
- Bob Hanson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCould return Integer, Float, Boolean, String, Map<String, Object>, Lstrequires { "key":"value", "key":"value",....}syntaxError
(String message) Make a JSONException to signal a syntax error.
-
Constructor Details
-
JSJSONParser
public JSJSONParser()
-
-
Method Details
-
parseMap
requires { "key":"value", "key":"value",....}- Parameters:
str
-asHashTable
- TODO- Returns:
- Map or null
-
parse
Could return Integer, Float, Boolean, String, Map<String, Object>, Lst- Parameters:
str
-asHashTable
-- Returns:
- a object equivalent to the JSON string str
-
syntaxError
Make a JSONException to signal a syntax error.- Parameters:
message
- The error message.- Returns:
- A JSONException object, suitable for throwing
-