public abstract class JsonService extends Object implements Service, Handler
Routing.Builder,
Routing.RulesHandler.EntityHandler<T>| Constructor and Description |
|---|
JsonService() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptsJson(ServerRequest request,
ServerResponse response)
Determines if JSON is an accepted response type, using
Accept and response Content-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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThenpublic void update(Routing.Rules routingRules)
protected boolean acceptsJson(ServerRequest request, ServerResponse response)
Accept and response Content-Type headers.
Sets the response Content-Type header if not set and JSON is accepted.
request - a server requestresponse - a server responsetrue if JSON is accepted.Copyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.