Package io.micronaut.http.server.netty
Class FormRouteCompleter
java.lang.Object
io.micronaut.http.server.netty.FormRouteCompleter
- All Implemented Interfaces:
Subscriber<Object>
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.- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescription<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.reactor.core.publisher.Flux<? extends MicronautHttpData<?>>
claimFieldsComplete
(String name) Claim all fields of the given name.reactor.core.publisher.Flux<? extends MicronautHttpData<?>>
claimFieldsRaw
(String name) Claim all fields of the given name.boolean
void
void
void
void
void
release()
toMap
(Charset charset, Collection<? extends MicronautHttpData<?>> dataList)
-
Method Details
-
getExecute
-
onSubscribe
- Specified by:
onSubscribe
in interfaceSubscriber<Object>
-
onNext
- Specified by:
onNext
in interfaceSubscriber<Object>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceSubscriber<Object>
-
onError
- Specified by:
onError
in interfaceSubscriber<Object>
-
claimFieldsRaw
Claim all fields of the given name. In the returned publisher, eachMicronautHttpData
may appear multiple times if there is new data.- Parameters:
name
- The field name- Returns:
- 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 thePartData
every time there is new data for the field.- Type Parameters:
R
- The return type of the factory- Parameters:
name
- The field namefieldFactory
- The factory to call when a new field is seen- Returns:
- A publisher of the objects returned by the factory
-
claimFieldsComplete
Claim all fields of the given name. The returned publisher will only contain fields that arecompleted
.- Parameters:
name
- The field name- Returns:
- The publisher of the complete fields
-
isClaimed
-
release
public void release() -
asMap
-
toMap
public static Map<String,Object> toMap(Charset charset, Collection<? extends MicronautHttpData<?>> dataList)
-