if (value instanceof JsonString) {
Object o;
try {
o = ((JsonString) value).toJsonString();
} catch (Exception e) {
throw new JsonException(e);
}
if (o instanceof String) {
return (String) o;
}
throw new JsonException("Bad value from toJSONString: " + o);
}
if (value instanceof Number) {
return numberToString((Number) value);
}
if (value instanceof Boolean || value instanceof JsonObject || value instanceof JsonArray) {