Class FormRouteCompleter

All Implemented Interfaces:
HttpBody, Subscriber<Object>

@Internal public final class FormRouteCompleter extends Object implements Subscriber<Object>, HttpBody
Special HttpBody that "demultiplexes" form data. Basically, this class receives a stream of MicronautHttpData and splits it into individual streams for each form field, and they can all be subscribed to and bound independently.
Jonas Konrad
  • Method Details

    • getExecute

      public DelayedExecutionFlow<RouteMatch<?>> getExecute()
    • onSubscribe

      public void onSubscribe(Subscription s)
      Specified by:
      onSubscribe in interface Subscriber<Object>
    • onNext

      public void onNext(Object o)
      Specified by:
      onNext in interface Subscriber<Object>
    • onComplete

      public void onComplete()
      Specified by:
      onComplete in interface Subscriber<Object>
    • onError

      public void onError(Throwable t)
      Specified by:
      onError in interface Subscriber<Object>
    • claimFieldsRaw

      public reactor.core.publisher.Flux<? extends MicronautHttpData<?>> claimFieldsRaw(String name)
      Claim all fields of the given name. In the returned publisher, each MicronautHttpData may appear multiple times if there is new data.
      name - The field name
      The publisher of data with this field name
    • claimFields

      public <R> reactor.core.publisher.Flux<R> claimFields(String name, BiFunction<? super MicronautHttpData<?>,? super reactor.core.publisher.Flux<PartData>,R> fieldFactory)
      Claim all fields of the given name. When a new field of the name is seen, fieldFactory is called with that field and a publisher that gets the PartData every time there is new data for the field.
      Type Parameters:
      R - The return type of the factory
      name - The field name
      fieldFactory - The factory to call when a new field is seen
      A publisher of the objects returned by the factory
    • claimFieldsComplete

      public reactor.core.publisher.Flux<? extends MicronautHttpData<?>> claimFieldsComplete(String name)
      Claim all fields of the given name. The returned publisher will only contain fields that are completed.
      name - The field name
      The publisher of the complete fields
    • isClaimed

      public boolean isClaimed(String name)
    • release

      public void release()
      Description copied from interface: HttpBody
      Release this body and any downstream representations.
      Specified by:
      release in interface HttpBody
    • next

      @Nullable public @Nullable HttpBody next()
      Description copied from interface: HttpBody
      Get the next representation this body was transformed into, if any.
      Specified by:
      next in interface HttpBody
      The next representation, or null if this body has not been transformed
    • asMap

      public Map<String,Object> asMap(Charset defaultCharset)