- java.lang.Object
-
- io.helidon.webserver.JsonService
-
- All Implemented Interfaces:
Handler,Service,BiConsumer<ServerRequest,ServerResponse>
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 booleanacceptsJson(ServerRequest request, ServerResponse response)Determines if JSON is an accepted response type, usingAcceptand responseContent-Typeheaders.protected MediaTypetoJsonResponseType(MediaType acceptedType)Returns the response type for the given type if it is an accepted JSON type.voidupdate(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, usingAcceptand responseContent-Typeheaders.Sets the response
Content-Typeheader if not set and JSON is accepted.- Parameters:
request- a server requestresponse- a server response- Returns:
trueif JSON is accepted.
-
-