use of playn.core.json.JsonParserException in project playn by threerings.
the class HtmlJson method parse.
@Override
public Object parse(String json) throws JsonParserException {
try {
JavaScriptObject jsonParse = jsonParse(json);
if (!isValueObject(jsonParse))
throw new JsonParserException(null, "Input JSON was not an object", -1, -1, -1);
HtmlObject object = (HtmlObject) unwrap0(jsonParse);
return object;
} catch (JavaScriptException e) {
throw new JsonParserException(e, "Failed to parse JSON", -1, -1, -1);
}
}
use of playn.core.json.JsonParserException in project playn by threerings.
the class HtmlJson method parseArray.
@Override
public Array parseArray(String json) throws JsonParserException {
try {
JavaScriptObject jsonParse = jsonParse(json);
if (!isValueArray(jsonParse))
throw new JsonParserException(null, "Input JSON was not an array", -1, -1, -1);
HtmlArray array = (HtmlArray) unwrap0(jsonParse);
return array;
} catch (JavaScriptException e) {
throw new JsonParserException(e, "Failed to parse JSON", -1, -1, -1);
}
}
Aggregations