Package org.n52.iceland.response
Class JSONResponseWriter
java.lang.Object
org.n52.iceland.coding.encode.AbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>
org.n52.iceland.response.JSONResponseWriter
- All Implemented Interfaces:
ResponseWriter<com.fasterxml.jackson.databind.JsonNode>,Component<ResponseWriterKey>,Keyed<ResponseWriterKey>
public class JSONResponseWriter
extends AbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>
TODO JavaDoc
- Since:
- 2.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the current contentTypegetKeys()voidsetContentType(MediaType contentType) Set the contentTypebooleansupportsGZip(com.fasterxml.jackson.databind.JsonNode t) Check if GZip is supported by this writervoidwrite(com.fasterxml.jackson.databind.JsonNode t, OutputStream out) Write object t toOutputStreamoutvoidwrite(com.fasterxml.jackson.databind.JsonNode t, OutputStream out, ResponseProxy responseProxy) Write object t toOutputStreamoutMethods inherited from class org.n52.iceland.coding.encode.AbstractResponseWriter
getEncodedContentType, getEncoder, getEncoderRepositoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.n52.iceland.coding.encode.ResponseWriter
getForcedHttpStatus, hasForcedHttpStatus, isSetContentType
-
Field Details
-
KEY
-
-
Constructor Details
-
JSONResponseWriter
-
-
Method Details
-
getKeys
-
write
public void write(com.fasterxml.jackson.databind.JsonNode t, OutputStream out, ResponseProxy responseProxy) throws IOException Description copied from interface:ResponseWriterWrite object t toOutputStreamout- Parameters:
t- Object to writeout-OutputStreamto be written toresponseProxy-ResponseProxygiving access to header and content length setters- Throws:
IOException- If an error occurs during writing
-
write
Description copied from interface:ResponseWriterWrite object t toOutputStreamout- Parameters:
t- Object to writeout-OutputStreamto be written to- Throws:
IOException- If an error occurs during writing
-
getContentType
Description copied from interface:ResponseWriterGet the current contentType- Specified by:
getContentTypein interfaceResponseWriter<com.fasterxml.jackson.databind.JsonNode>- Overrides:
getContentTypein classAbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>- Returns:
- the contenType
-
setContentType
Description copied from interface:ResponseWriterSet the contentType- Specified by:
setContentTypein interfaceResponseWriter<com.fasterxml.jackson.databind.JsonNode>- Overrides:
setContentTypein classAbstractResponseWriter<com.fasterxml.jackson.databind.JsonNode>- Parameters:
contentType- to set
-
supportsGZip
public boolean supportsGZip(com.fasterxml.jackson.databind.JsonNode t) Description copied from interface:ResponseWriterCheck if GZip is supported by this writer- Parameters:
t- Object to write- Returns:
true, if GZip is supported
-