Class SerializerSession.Builder<SELF extends SerializerSession.Builder<SELF>>

Direct Known Subclasses:
OutputStreamSerializerSession.Builder, SerializerSession.DefaultBuilder, WriterSerializerSession.Builder
Enclosing class:
SerializerSession

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

    • Builder

      protected Builder(Serializer 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 MarshallingSession.Builder<SELF extends SerializerSession.Builder<SELF>>
      Returns:
      The built object.
    • javaMethod

      public SELF javaMethod(Method value)
      The java method that called this serializer, usually the method in a REST servlet.
      Parameters:
      value - The new property value.
      Can be null (value will not be set, existing value will be kept).
      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 MarshallingTraverseSession.Builder<SELF extends SerializerSession.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.
    • resolver

      String variable resolver.

      If not specified, defaults to session created by VarResolver.DEFAULT.

      Parameters:
      value - The new property value.
      Can be null (value will not be set, defaults to session created by VarResolver.DEFAULT when accessed).
      Returns:
      This object.
    • schema

      public SELF schema(HttpPartSchema value)
      HTTP-part schema.

      Used for schema-based serializers and parsers to define additional formatting.

      Parameters:
      value - The new value for this property.
      Can be null (value will not be set, existing value will be kept).
      Returns:
      This object.
    • schemaDefault

      Same as schema(HttpPartSchema) but doesn't overwrite the value if it is already set.
      Parameters:
      value - The new value for this property.
      Can be null (value will not be set).
      Returns:
      This object.
    • uriContext

      public SELF uriContext(UriContext value)
      URI context bean.

      Bean used for resolution of URIs to absolute or root-relative form.

      If not specified, defaults to Serializer.Builder.uriContext(UriContext).

      Parameters:
      value - The new property value.
      Can be null (value will not be set, defaults to Serializer.Builder.uriContext(UriContext) from context).
      Returns:
      This object.
    • keepNullProperties

      public SELF keepNullProperties(boolean value)
      Keep null bean property values.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • nonDefault

      public SELF nonDefault(boolean value)
      Non-default inclusion.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
      Since:
      10.0.0
    • trimStrings

      public SELF trimStrings(boolean value)
      Trim strings.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • addBeanTypes

      public SELF addBeanTypes(boolean value)
      Add bean types.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • addRootType

      public SELF addRootType(boolean value)
      Add root type.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • sortCollections

      public SELF sortCollections(boolean value)
      Sort collections.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • sortMaps

      public SELF sortMaps(boolean value)
      Sort maps.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • trimEmptyCollections

      public SELF trimEmptyCollections(boolean value)
      Trim empty collections.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • trimEmptyMaps

      public SELF trimEmptyMaps(boolean value)
      Trim empty maps.
      Parameters:
      value - The new value for this property.
      Returns:
      This object.