- All Superinterfaces:
ResponseBody
A response body with payload encoding support.
Implementors should rely on MediaTypeConverter
to encode a payload based on the content type of the response.
If no content-type header is specified in the response when encoding the payload, implementors may use the definition of the route serving the resource and especially the produced media type when specified to determine the converter to use.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A server-sent events data producer used to encode data from a single object or many objects.Nested classes/interfaces inherited from interface io.inverno.mod.http.server.ResponseBody
ResponseBody.Resource, ResponseBody.Sse<A,
B extends ResponseBody.Sse.Event<A>, C extends ResponseBody.Sse.EventFactory<A, B>> -
Method Summary
Modifier and TypeMethodDescription<T> OutboundDataEncoder
<T> encoder()
Returns an encoder to encode a payload based on the content type of the request.<T> OutboundDataEncoder
<T> Returns an encoder to encode a payload of the specified type based on the content type of the request.<T> OutboundDataEncoder
<T> Returns an encoder to encode a payload of the specified type based on the content type of the request.<T> WebResponseBody.SseEncoder
<T> sseEncoder
(String mediaType) Returns a server-sent events encoder to encode event's data in the specified media type.<T> WebResponseBody.SseEncoder
<T> sseEncoder
(String mediaType, Class<T> type) Returns a server-sent events encoder to encode event's data of the specified type in the specified media type.<T> WebResponseBody.SseEncoder
<T> sseEncoder
(String mediaType, Type type) Returns a server-sent events encoder to encode event's data of the specified type in the specified media type.Transforms the payload publisher.
-
Method Details
-
transform
Description copied from interface:ResponseBody
Transforms the payload publisher.
This can be used in an exchange interceptor in order to decorate response data publisher.
- Specified by:
transform
in interfaceResponseBody
- Parameters:
transformer
- a request payload publisher transformer- Returns:
- the request body
-
encoder
Returns an encoder to encode a payload based on the content type of the request.
- Type Parameters:
T
- the type to encode- Returns:
- an encoder
-
encoder
Returns an encoder to encode a payload of the specified type based on the content type of the request.
- Type Parameters:
T
- the type to encode- Parameters:
type
- a class of T- Returns:
- an encoder
-
encoder
Returns an encoder to encode a payload of the specified type based on the content type of the request.
- Type Parameters:
T
- the type to encode- Parameters:
type
- the type to encode- Returns:
- an encoder
-
sseEncoder
Returns a server-sent events encoder to encode event's data in the specified media type.
- Type Parameters:
T
- the type to encode- Parameters:
mediaType
- the target media type- Returns:
- a SSE encoder
-
sseEncoder
Returns a server-sent events encoder to encode event's data of the specified type in the specified media type.
- Type Parameters:
T
- the type to encode- Parameters:
mediaType
- the target media typetype
- a class of T- Returns:
- a SSE encoder
-
sseEncoder
Returns a server-sent events encoder to encode event's data of the specified type in the specified media type.
- Type Parameters:
T
- the type to encode- Parameters:
mediaType
- the target media typetype
- the type to encode- Returns:
- a SSE encoder
-