Package org.restheart.exchange
Class JsonResponse
java.lang.Object
org.restheart.exchange.Exchange<com.google.gson.JsonElement>
org.restheart.exchange.Response<com.google.gson.JsonElement>
org.restheart.exchange.ServiceResponse<com.google.gson.JsonElement>
org.restheart.exchange.JsonResponse
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Field Summary
Fields inherited from class org.restheart.exchange.ServiceResponse
contentFields inherited from class org.restheart.exchange.Exchange
APPLICATION_PDF_TYPE, FORM_URLENCODED, HAL_JSON_MEDIA_TYPE, IN_ERROR_KEY, JSON_MEDIA_TYPE, MAX_BUFFERS, MAX_CONTENT_SIZE, MULTIPART, TEXT_PLAIN_CONTENT_TYPE, wrapped -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJsonResponse(io.undertow.server.HttpServerExchange exchange) -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonResponseinit(io.undertow.server.HttpServerExchange exchange) static JsonResponseof(io.undertow.server.HttpServerExchange exchange) Reads the content as a String.voidsetContent(GsonUtils.ArrayBuilder builder) voidsetContent(GsonUtils.ObjectBuilder builder) voidsetInError(int code, String message, Throwable t) Methods inherited from class org.restheart.exchange.ServiceResponse
getContent, getCustomSender, of, setContent, setCustomSenderMethods inherited from class org.restheart.exchange.Response
getContentType, getContentType, getHeader, getHeader, getHeaders, getMDCContext, getStatusCode, setContentType, setContentTypeAsJson, setHeader, setHeader, setInError, setMDCContext, setStatusCodeMethods inherited from class org.restheart.exchange.Exchange
getExchange, getWrappedExchange, isAccountInRole, isAuthenticated, isAuthenticated, isContentTypeFormOrMultipart, isContentTypeFormOrMultipart, isContentTypeJson, isContentTypeJson, isContentTypeText, isContentTypeXml, isInError, isInError, responseInterceptorsExecuted, setInError, setInError, setResponseInterceptorsExecuted, updateBufferSize
-
Constructor Details
-
JsonResponse
protected JsonResponse(io.undertow.server.HttpServerExchange exchange)
-
-
Method Details
-
init
-
of
-
readContent
Description copied from class:ServiceResponseReads the content as a String. This method is used by ResponseSender to generate the response content to send to the client.- Specified by:
readContentin classServiceResponse<com.google.gson.JsonElement>- Returns:
- the content as string
-
setContent
-
setContent
-
setInError
- Specified by:
setInErrorin classServiceResponse<com.google.gson.JsonElement>- Parameters:
code-message-t-
-