Class ParserSession.Builder<SELF extends ParserSession.Builder<SELF>>

Direct Known Subclasses:
InputStreamParserSession.Builder, ParserSession.DefaultBuilder, ReaderParserSession.Builder
Enclosing class:
ParserSession

public abstract static class ParserSession.Builder<SELF extends ParserSession.Builder<SELF>> extends MarshallingSession.Builder<SELF>
Builder class.
  • Constructor Details

    • Builder

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

    • build

      public ParserSession build()
      Description copied from class: MarshallingSession.Builder
      Build the object.
      Overrides:
      build in class MarshallingSession.Builder<SELF extends ParserSession.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 to leave (or clear) the associated java method unset.
      Returns:
      This object.
    • outer

      public SELF outer(Object value)
      The outer object for instantiating top-level non-static inner classes.
      Parameters:
      value - The new property value.
      Can be null (no outer object will be used, suitable for static or top-level classes).
      Returns:
      This object.
    • maxParseDepth

      public SELF maxParseDepth(int value)
      The shared recursive-parse-depth budget honored by binary codec sessions (CBOR, Protobuf, MsgPack) at their recursive databind entry points.
      Parameters:
      value - The new property value.
      Defaults to 1000.
      Returns:
      This object.
      See Also:
    • 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 MarshallingSession.Builder<SELF extends ParserSession.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.
    • trimStrings

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

      public SELF nulls(Nulls value)
      Per-session override for the parser's null-coercion policy.
      Parameters:
      value - The new value for this setting. null is treated as Nulls.NOT_SET.
      Returns:
      This object.
      Since:
      10.0.0
      See Also:
    • 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 (will not set the value, keeps existing schema or remains null).
      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.
      If null, the value will not be set (keeps existing schema or remains null).
      Returns:
      This object.