Code example for Writer

Methods: write

0
public class SimpleReferenceJsonSerializer implements JsonSerializer<Reference<Number, String>> {
 
    @Override 
    public void serialize(final Reference<Number, String> src, final JsonWriter jw) throws IOException, InvocationTargetException, IllegalAccessException {
        final Writer out = jw.getOutputWriter();
        out.write("{id:");
        out.write(src.getId().toString());
        out.write(",desc:");
        JsonUtil.encodeString(src.getText(), out);
        out.write('}');
    } 
}