@Test public void testPrettyPrint() { String json = CONV.prettyPrint("{three:lines}"); Assert.assertEquals( "{\n" + " \"three\": \"lines\"\n" + "}", json); Properties properties = new Properties(); properties.setProperty("json.prettyprint", "false"); properties.setProperty("json.lenient", "false"); CONV.configure(properties); json = CONV.prettyPrint("{three:lines}"); properties.clear(); CONV.configure(null); Assert.assertEquals( "{\n" + " \"three\": \"lines\"\n" + "}", json); }
@Override public String prettyPrint(String json) { return builder().setLenient().setPrettyPrinting().create().toJson(new JsonParser().parse(json)); }
JsonConverterGSON implements JsonConverter { @Override public String prettyPrint(String json) { return builder().setLenient().setPrettyPrinting().create().toJson(new JsonParser().parse(json)); } }
JsonConverterGSON implements JsonConverter { @Override public String prettyPrint(String json) { return builder().setLenient().setPrettyPrinting().create().toJson(new JsonParser().parse(json)); }  }
JsonConverterGSON implements JsonConverter { @Override public String prettyPrint(String json) { return builder().setLenient().setPrettyPrinting().create().toJson(new JsonParser().parse(json)); }  @Override void addAdapter(Type type, Object adapter); @Override JsonConverterGSON configure(Properties properties); @Override RpcErrorResponse errorFromJson(String json); @Override RpcResponse<T> responseFromJson(String json, Class<T> resultClass); @Override T fromJson(String json, Class<T> resultClass); @Override String prettyPrint(String json); @Override String toRpcJson(Object input); @Override String toGenericJson(Object object, Type runtimeType); @Override String getName(); }
JsonConverterGSON implements JsonConverter { @Override public String prettyPrint(String json) { return builder().setLenient().setPrettyPrinting().create().toJson(new JsonParser().parse(json)); }  @Override void addAdapter(Type type, Object adapter); @Override JsonConverterGSON configure(Properties properties); @Override RpcErrorResponse errorFromJson(String json); @Override RpcResponse<T> responseFromJson(String json, Class<T> resultClass); @Override T fromJson(String json, Class<T> resultClass); @Override String prettyPrint(String json); @Override String toRpcJson(Object input); @Override String toGenericJson(Object object, Type runtimeType); @Override String getName(); static final String NAME; }