Package 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)configuringJsonGenerator
constructed for writing output.- Since:
- 2.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description CharacterEscapes
characterEscapes
Caller may want to specify character escaping details, either as defaults, or on call-by-call basis.static ObjectWriter.GeneratorSettings
empty
PrettyPrinter
prettyPrinter
To allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as wellSerializableString
rootValueSeparator
Caller may want to override so-called "root value separator", String added (verbatim, with no quoting or escaping) between values in root context.FormatSchema
schema
When using data format that uses a schema, schema is passed to generator.
-
Constructor Summary
Constructors Constructor Description GeneratorSettings(PrettyPrinter pp, FormatSchema sch, CharacterEscapes esc, SerializableString rootSep)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(JsonGenerator gen)
ObjectWriter.GeneratorSettings
with(FormatSchema sch)
ObjectWriter.GeneratorSettings
with(CharacterEscapes esc)
ObjectWriter.GeneratorSettings
with(PrettyPrinter pp)
ObjectWriter.GeneratorSettings
withRootValueSeparator(SerializableString sep)
ObjectWriter.GeneratorSettings
withRootValueSeparator(java.lang.String sep)
-
-
-
Field Detail
-
empty
public static final ObjectWriter.GeneratorSettings empty
-
prettyPrinter
public final PrettyPrinter prettyPrinter
To allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as well
-
schema
public final FormatSchema schema
When using data format that uses a schema, schema is passed to generator.
-
characterEscapes
public final CharacterEscapes characterEscapes
Caller may want to specify character escaping details, either as defaults, or on call-by-call basis.
-
rootValueSeparator
public final 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
-
GeneratorSettings
public GeneratorSettings(PrettyPrinter pp, FormatSchema sch, CharacterEscapes esc, SerializableString rootSep)
-
-
Method Detail
-
with
public ObjectWriter.GeneratorSettings with(PrettyPrinter pp)
-
with
public ObjectWriter.GeneratorSettings with(FormatSchema sch)
-
with
public ObjectWriter.GeneratorSettings with(CharacterEscapes esc)
-
withRootValueSeparator
public ObjectWriter.GeneratorSettings withRootValueSeparator(java.lang.String sep)
-
withRootValueSeparator
public ObjectWriter.GeneratorSettings withRootValueSeparator(SerializableString sep)
-
initialize
public void initialize(JsonGenerator gen)
- Since:
- 2.6
-
-