Printer

final case class Printer(dropNullValues: Boolean, indent: String, lbraceLeft: String, lbraceRight: String, rbraceLeft: String, rbraceRight: String, lbracketLeft: String, lbracketRight: String, rbracketLeft: String, rbracketRight: String, lrbracketsEmpty: String, arrayCommaLeft: String, arrayCommaRight: String, objectCommaLeft: String, objectCommaRight: String, colonLeft: String, colonRight: String, reuseWriters: Boolean, predictSize: Boolean, escapeNonAscii: Boolean, sortKeys: Boolean)

A pretty-printer for JSON values.

Value parameters:
arrayCommaLeft

Spaces to insert to left of a comma in an array.

arrayCommaRight

Spaces to insert to right of a comma in an array.

colonLeft

Spaces to insert to left of a colon.

colonRight

Spaces to insert to right of a colon.

dropNullValues

Determines if object fields with values of null are dropped from the output.

escapeNonAscii

Unicode-escape any non-ASCII characters in strings.

indent

The indentation to use if any format strings contain a new line.

lbraceLeft

Spaces to insert to left of a left brace.

lbraceRight

Spaces to insert to right of a left brace.

lbracketLeft

Spaces to insert to left of a left bracket.

lbracketRight

Spaces to insert to right of a left bracket.

lrbracketsEmpty

Spaces to insert for an empty array.

objectCommaLeft

Spaces to insert to left of a comma in an object.

objectCommaRight

Spaces to insert to right of a comma in an object.

predictSize

Uses an adaptive size predictor to avoid grow-and-copy steps while printing into a binary output.

rbraceLeft

Spaces to insert to left of a right brace.

rbraceRight

Spaces to insert to right of a right brace.

rbracketLeft

Spaces to insert to left of a right bracket.

rbracketRight

Spaces to insert to right of a right bracket.

reuseWriters

Determines whether the printer will reuse Appendables via thread-local storage.

sortKeys

Determines whether the fields should be sorted.

Companion:
object
Source:
Printer.scala
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

final def printToByteBuffer(json: Json, cs: Charset): ByteBuffer
final def printToByteBuffer(json: Json): ByteBuffer
final def unsafePrintToAppendable(json: Json, out: Appendable): Unit

Prints the JSON value by appending directly to the provided Appendable. This method is UNSAFE and SIDE-EFFECTING!

Prints the JSON value by appending directly to the provided Appendable. This method is UNSAFE and SIDE-EFFECTING!

Source:
Printer.scala

The same pretty-printer configuration that outputs fields in sorted order.

The same pretty-printer configuration that outputs fields in sorted order.

Source:
Printer.scala

Inherited methods

Inherited from:
Product