Package io.helidon.webserver
Class JsonService
- java.lang.Object
-
- io.helidon.webserver.JsonService
-
- All Implemented Interfaces:
Handler
,Service
,BiConsumer<ServerRequest,ServerResponse>
- Direct Known Subclasses:
JacksonSupport
,JsonBindingSupport
,JsonSupport
public abstract class JsonService extends Object implements Service, Handler
- See Also:
Routing.Builder
,Routing.Rules
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.webserver.Handler
Handler.EntityHandler<T>
-
-
Constructor Summary
Constructors Constructor Description JsonService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
acceptsJson(ServerRequest request, ServerResponse response)
Determines if JSON is an accepted response type, usingAccept
and responseContent-Type
headers.protected MediaType
toJsonResponseType(MediaType acceptedType)
Returns the response type for the given type if it is an accepted JSON type.void
update(Routing.Rules routingRules)
Registers this handler for any HTTP method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiConsumer
andThen
-
-
-
-
Method Detail
-
update
public void update(Routing.Rules routingRules)
Registers this handler for any HTTP method.
-
acceptsJson
protected boolean acceptsJson(ServerRequest request, ServerResponse response)
Determines if JSON is an accepted response type, usingAccept
and responseContent-Type
headers.Sets the response
Content-Type
header if not set and JSON is accepted.- Parameters:
request
- a server requestresponse
- a server response- Returns:
true
if JSON is accepted.
-
-