Class WriterSerializerSession.Builder<SELF extends WriterSerializerSession.Builder<SELF>>

Direct Known Subclasses:
CsvSerializerSession.Builder, HjsonSerializerSession.Builder, HoconSerializerSession.Builder, IniSerializerSession.Builder, JsonSerializerSession.Builder, MarkdownSerializerSession.Builder, PlainTextSerializerSession.Builder, RdfSerializerSession.Builder, SseSerializerSession.Builder, TomlSerializerSession.Builder, UonSerializerSession.Builder, WriterSerializerSession.DefaultBuilder, XmlSerializerSession.Builder, YamlSerializerSession.Builder
Enclosing class:
WriterSerializerSession

public abstract static class WriterSerializerSession.Builder<SELF extends WriterSerializerSession.Builder<SELF>> extends SerializerSession.Builder<SELF>
Builder class.
  • Constructor Details

    • Builder

      protected Builder(WriterSerializer ctx)
      Constructor
      Parameters:
      ctx - The context creating this session.
      Cannot be null.
  • Method Details

    • build

      Description copied from class: MarshallingSession.Builder
      Build the object.
      Overrides:
      build in class SerializerSession.Builder<SELF extends WriterSerializerSession.Builder<SELF>>
      Returns:
      The built object.
    • maxIndent

      public SELF maxIndent(int value)
      Maximum indentation.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • property

      public SELF property(String key, Object value)
      Description copied from class: ContextSession.Builder
      Adds a property to this session.

      If the key matches a known session property (e.g. "debug" or "ContextSession.debug"), the value is converted via BasicConverter and routed to the corresponding typed setter. Unknown keys are stored in the raw session properties map.

      Overrides:
      property in class SerializerSession.Builder<SELF extends WriterSerializerSession.Builder<SELF>>
      Parameters:
      key - The property key.
      Cannot be null.
      value - The property value.
      Can be null (resets typed properties to their default; removes raw properties).
      Returns:
      This object.
    • quoteChar

      public SELF quoteChar(char value)
      Quote character.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • streamCharset

      public SELF streamCharset(Charset value)
      Output stream charset.

      The character set to use when writing to OutputStreams.

      Used when passing in output streams and byte arrays to Serializer.write(Object, Object).

      If not specified, defaults to UTF-8.

      Parameters:
      value - The new property value.
      Can be null (value will not be set, defaults to UTF-8).
      Returns:
      This object.
    • useWhitespace

      public SELF useWhitespace(Boolean value)
      Use whitespace.

      If true, whitespace is added to the output to improve readability.

      Parameters:
      value - The new property value.
      Can be null (value will not be set, existing value from context will be kept).
      Returns:
      This object.