public class JSONResponseWriter extends AbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>
| Modifier and Type | Field and Description |
|---|---|
static ResponseWriterKey |
KEY |
| Constructor and Description |
|---|
JSONResponseWriter(EncoderRepository encoderRepository) |
| Modifier and Type | Method and Description |
|---|---|
MediaType |
getContentType()
Get the current contentType
|
Set<ResponseWriterKey> |
getKeys() |
void |
setContentType(MediaType contentType)
Set the contentType
|
boolean |
supportsGZip(com.fasterxml.jackson.databind.JsonNode t)
Check if GZip is supported by this writer
|
void |
write(com.fasterxml.jackson.databind.JsonNode t,
OutputStream out,
ResponseProxy responseProxy)
Write object t to
OutputStream out |
getEncodedContentType, getEncoder, getEncoderRepositoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetForcedHttpStatus, hasForcedHttpStatus, isSetContentTypepublic static final ResponseWriterKey KEY
public JSONResponseWriter(EncoderRepository encoderRepository)
public Set<ResponseWriterKey> getKeys()
public void write(com.fasterxml.jackson.databind.JsonNode t,
OutputStream out,
ResponseProxy responseProxy)
throws IOException
ResponseWriterOutputStream outt - Object to writeout - OutputStream to be written toresponseProxy - ResponseProxy giving access to header and content length settersIOException - If an error occurs during writingpublic MediaType getContentType()
ResponseWritergetContentType in interface ResponseWriter<com.fasterxml.jackson.databind.JsonNode>getContentType in class AbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>public void setContentType(MediaType contentType)
ResponseWritersetContentType in interface ResponseWriter<com.fasterxml.jackson.databind.JsonNode>setContentType in class AbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>contentType - to setpublic boolean supportsGZip(com.fasterxml.jackson.databind.JsonNode t)
ResponseWritert - Object to writetrue, if GZip is supportedCopyright © 2015–2020 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.