like #fromJSON(String), but also check that there is nothing remaining in the given string after closing bracket. Throws ParseException otherwise.
(String json)
| 41 | * string after closing bracket. Throws {@link ParseException} otherwise. |
| 42 | */ |
| 43 | public static Object fromJSONStrict(String json) throws IOException { |
| 44 | JSONParser p = new JSONParser(json); |
| 45 | final Object val = getVal(p); |
| 46 | checkEOF(p); |
| 47 | return val; |
| 48 | } |
| 49 | |
| 50 | public static void checkEOF(JSONParser p) throws IOException { |
| 51 | if (p.nextEvent() != JSONParser.EOF) { |