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 Modifier and Type Field Description static ResponseWriterKeyKEY
-
Constructor Summary
Constructors Constructor Description JSONResponseWriter(EncoderRepository encoderRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaTypegetContentType()Get the current contentTypeSet<ResponseWriterKey>getKeys()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, ResponseProxy responseProxy)Write object t toOutputStreamout-
Methods inherited from class org.n52.iceland.coding.encode.AbstractResponseWriter
getEncodedContentType, getEncoder, getEncoderRepository
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.n52.iceland.coding.encode.ResponseWriter
getForcedHttpStatus, hasForcedHttpStatus, isSetContentType
-
-
-
-
Field Detail
-
KEY
public static final ResponseWriterKey KEY
-
-
Constructor Detail
-
JSONResponseWriter
public JSONResponseWriter(EncoderRepository encoderRepository)
-
-
Method Detail
-
getKeys
public Set<ResponseWriterKey> getKeys()
-
write
public void write(com.fasterxml.jackson.databind.JsonNode t, OutputStream out, ResponseProxy responseProxy) throws IOExceptionDescription 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
-
getContentType
public MediaType 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
public void setContentType(MediaType contentType)
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
-
-