Created
June 1, 2010 17:36
-
-
Save electrum/421210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NewlinePrettyPrinter implements PrettyPrinter | |
{ | |
@Override | |
public void writeRootValueSeparator(JsonGenerator jg) throws IOException | |
{ | |
jg.writeRaw('\n'); | |
} | |
@Override | |
public void writeStartObject(JsonGenerator jg) throws IOException | |
{ | |
jg.writeRaw('{'); | |
} | |
@Override | |
public void writeEndObject(JsonGenerator jg, int nrOfEntries) throws IOException | |
{ | |
jg.writeRaw('}'); | |
} | |
@Override | |
public void writeObjectEntrySeparator(JsonGenerator jg) throws IOException | |
{ | |
jg.writeRaw(','); | |
} | |
@Override | |
public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException | |
{ | |
jg.writeRaw(':'); | |
} | |
@Override | |
public void writeStartArray(JsonGenerator jg) throws IOException | |
{ | |
jg.writeRaw('['); | |
} | |
@Override | |
public void writeEndArray(JsonGenerator jg, int nrOfValues) throws IOException | |
{ | |
jg.writeRaw(']'); | |
} | |
@Override | |
public void writeArrayValueSeparator(JsonGenerator jg) throws IOException | |
{ | |
jg.writeRaw(','); | |
} | |
@Override | |
public void beforeArrayValues(JsonGenerator jg) throws IOException | |
{ | |
// ignore | |
} | |
@Override | |
public void beforeObjectEntries(JsonGenerator jg) throws IOException | |
{ | |
// ignore | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment