com.fasterxml.jackson.databind

## Class ObjectWriter.GeneratorSettings

- java.lang.Object
- - com.fasterxml.jackson.databind.ObjectWriter.GeneratorSettings

- All Implemented Interfaces:
    java.io.Serializable
  Enclosing class:
    ObjectWriter

      public static final class ObjectWriter.GeneratorSettings
      extends java.lang.Object
      implements java.io.Serializable

  Helper class used for containing settings specifically related to (re)configuring `JsonGenerator` constructed for writing output.
  Since:
    2.5
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `com.fasterxml.jackson.core.io.CharacterEscapes` | `characterEscapes` Caller may want to specify character escaping details, either as defaults, or on call-by-call basis.
    `static ObjectWriter.GeneratorSettings` | `empty`
    `com.fasterxml.jackson.core.PrettyPrinter` | `prettyPrinter` To allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as well
    `com.fasterxml.jackson.core.SerializableString` | `rootValueSeparator` Caller may want to override so-called "root value separator", String added (verbatim, with no quoting or escaping) between values in root context.
    `com.fasterxml.jackson.core.FormatSchema` | `schema` When using data format that uses a schema, schema is passed to generator.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectWriter.GeneratorSettings(com.fasterxml.jackson.core.PrettyPrinter pp, com.fasterxml.jackson.core.FormatSchema sch, com.fasterxml.jackson.core.io.CharacterEscapes esc, com.fasterxml.jackson.core.SerializableString rootSep)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `initialize(com.fasterxml.jackson.core.JsonGenerator gen)`
    `ObjectWriter.GeneratorSettings` | `with(com.fasterxml.jackson.core.io.CharacterEscapes esc)`
    `ObjectWriter.GeneratorSettings` | `with(com.fasterxml.jackson.core.FormatSchema sch)`
    `ObjectWriter.GeneratorSettings` | `with(com.fasterxml.jackson.core.PrettyPrinter pp)`
    `ObjectWriter.GeneratorSettings` | `withRootValueSeparator(com.fasterxml.jackson.core.SerializableString sep)`
    `ObjectWriter.GeneratorSettings` | `withRootValueSeparator(java.lang.String sep)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### empty

          public static final ObjectWriter.GeneratorSettings empty

    - #### prettyPrinter

          public final com.fasterxml.jackson.core.PrettyPrinter prettyPrinter

      To allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as well

    - #### schema

          public final com.fasterxml.jackson.core.FormatSchema schema

      When using data format that uses a schema, schema is passed to generator.

    - #### characterEscapes

          public final com.fasterxml.jackson.core.io.CharacterEscapes characterEscapes

      Caller may want to specify character escaping details, either as defaults, or on call-by-call basis.

    - #### rootValueSeparator

          public final com.fasterxml.jackson.core.SerializableString rootValueSeparator

      Caller may want to override so-called "root value separator", String added (verbatim, with no quoting or escaping) between values in root context. Default value is a single space character, but this is often changed to linefeed.

  - ### Constructor Detail

    - #### ObjectWriter.GeneratorSettings

          public ObjectWriter.GeneratorSettings(com.fasterxml.jackson.core.PrettyPrinter pp,
                                        com.fasterxml.jackson.core.FormatSchema sch,
                                        com.fasterxml.jackson.core.io.CharacterEscapes esc,
                                        com.fasterxml.jackson.core.SerializableString rootSep)

  - ### Method Detail

    - #### with

          public ObjectWriter.GeneratorSettings with(com.fasterxml.jackson.core.PrettyPrinter pp)

    - #### with

          public ObjectWriter.GeneratorSettings with(com.fasterxml.jackson.core.FormatSchema sch)

    - #### with

          public ObjectWriter.GeneratorSettings with(com.fasterxml.jackson.core.io.CharacterEscapes esc)

    - #### withRootValueSeparator

          public ObjectWriter.GeneratorSettings withRootValueSeparator(java.lang.String sep)

    - #### withRootValueSeparator

          public ObjectWriter.GeneratorSettings withRootValueSeparator(com.fasterxml.jackson.core.SerializableString sep)

    - #### initialize

          public void initialize(com.fasterxml.jackson.core.JsonGenerator gen)

      Since:
        2.6