Package org.n52.iceland.coding.encode
Interface ResponseWriter<T>
- Type Parameters:
T- the entity type
- All Superinterfaces:
Component<ResponseWriterKey>,Keyed<ResponseWriterKey>
- All Known Implementing Classes:
AbstractResponseWriter,EXIResponseWriter,JSONResponseWriter,SoapChainResponseWriter,XmlResponseWriter
TODO JavaDoc
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the current contentTypedefault MediaTypegetEncodedContentType(ResponseFormat responseFormat) default HTTPStatusdefault booleandefault booleanCheck if contentType is setvoidsetContentType(MediaType contentType) Set the contentTypebooleansupportsGZip(T t) Check if GZip is supported by this writervoidwrite(T t, OutputStream out) Write object t toOutputStreamoutvoidwrite(T t, OutputStream out, ResponseProxy responseProxy) Write object t toOutputStreamout
-
Method Details
-
getContentType
MediaType getContentType()Get the current contentType- Returns:
- the contenType
-
setContentType
Set the contentType- Parameters:
contentType- to set
-
isSetContentType
default boolean isSetContentType()Check if contentType is set- Returns:
true, if contentType is set
-
write
void write(T t, OutputStream out, ResponseProxy responseProxy) throws IOException, EncodingException Write 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 writingEncodingException- if an errors occurs during encoding
-
write
Write object t toOutputStreamout- Parameters:
t- Object to writeout-OutputStreamto be written to- Throws:
IOException- If an error occurs during writingEncodingException- if an errors occurs during encoding
-
supportsGZip
Check if GZip is supported by this writer- Parameters:
t- Object to write- Returns:
true, if GZip is supported
-
getEncodedContentType
-
hasForcedHttpStatus
-
getForcedHttpStatus
-