forked from openrs2/openrs2
This produces identical output to the Firefox pretty printer. Signed-off-by: Graham <gpe@openrs2.org>
parent
bdab767ca7
commit
3ff6cd2d02
@ -0,0 +1,24 @@ |
||||
package org.openrs2.json |
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator |
||||
import com.fasterxml.jackson.core.util.DefaultIndenter |
||||
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter |
||||
|
||||
public class JsonPrettyPrinter : DefaultPrettyPrinter() { |
||||
init { |
||||
indentArraysWith(UNIX_INDENT) |
||||
indentObjectsWith(UNIX_INDENT) |
||||
} |
||||
|
||||
override fun createInstance(): DefaultPrettyPrinter { |
||||
return JsonPrettyPrinter() |
||||
} |
||||
|
||||
override fun writeObjectFieldValueSeparator(g: JsonGenerator) { |
||||
g.writeRaw(": ") |
||||
} |
||||
|
||||
private companion object { |
||||
private val UNIX_INDENT = DefaultIndenter(" ", "\n") |
||||
} |
||||
} |
Loading…
Reference in new issue