public final class JsonParser extends Object
The parsing is almost identical to the normal parser provided by GSON with these changes: it never uses "lenient" mode, it rejects duplicated map keys and it rejects strings with invalid UTF16 characters.
The implementation is adapted from almost identical to GSON's TypeAdapters.JSON_ELEMENT.
| Modifier and Type | Method and Description |
|---|---|
static long |
getParsedNumberAsLongOrThrow(com.google.gson.JsonElement element) |
static boolean |
isValidString(String s) |
static com.google.gson.JsonElement |
parse(String json) |
public static boolean isValidString(String s)
public static com.google.gson.JsonElement parse(String json) throws IOException
IOExceptionpublic static long getParsedNumberAsLongOrThrow(com.google.gson.JsonElement element)