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.SerializableHelper class used for containing settings specifically related to (re)configuringJsonGeneratorconstructed for writing output.- Since:
- 2.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description CharacterEscapescharacterEscapesCaller may want to specify character escaping details, either as defaults, or on call-by-call basis.static ObjectWriter.GeneratorSettingsemptyPrettyPrinterprettyPrinterTo allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as wellSerializableStringrootValueSeparatorCaller may want to override so-called "root value separator", String added (verbatim, with no quoting or escaping) between values in root context.FormatSchemaschemaWhen 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 voidinitialize(JsonGenerator gen)ObjectWriter.GeneratorSettingswith(FormatSchema sch)ObjectWriter.GeneratorSettingswith(CharacterEscapes esc)ObjectWriter.GeneratorSettingswith(PrettyPrinter pp)ObjectWriter.GeneratorSettingswithRootValueSeparator(SerializableString sep)ObjectWriter.GeneratorSettingswithRootValueSeparator(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
-
-