252627282930313233
private JSONWriter jsonWriter; @BeforeMethod() protected void setUpObjects() { renderer = new JavascriptDateOutputRenderer(); result = new StringWriter(); jsonWriter = new JSONWriter(result); }
2425262728293031323334
writer.object(); writer.key("1"); writer.value(calendar); IJsonWriter innerWriter = new DelegatingJSONWriter(writer); innerWriter.addRenderer(Calendar.class, new JavascriptDateOutputRenderer()); innerWriter.key("2"); innerWriter.value(calendar); writer.key("3"); writer.value(calendar);