T - the entity typepublic interface ResponseWriter<T> extends Component<ResponseWriterKey>
| Modifier and Type | Method and Description |
|---|---|
MediaType |
getContentType()
Get the current contentType
|
default MediaType |
getEncodedContentType(ResponseFormat responseFormat) |
default HTTPStatus |
getForcedHttpStatus(T t) |
default boolean |
hasForcedHttpStatus(T t) |
default boolean |
isSetContentType()
Check if contentType is set
|
void |
setContentType(MediaType contentType)
Set the contentType
|
boolean |
supportsGZip(T t)
Check if GZip is supported by this writer
|
void |
write(T t,
OutputStream out,
ResponseProxy responseProxy)
Write object t to
OutputStream out |
MediaType getContentType()
void setContentType(MediaType contentType)
contentType - to setdefault boolean isSetContentType()
true, if contentType is setvoid write(T t, OutputStream out, ResponseProxy responseProxy) throws IOException, EncodingException
OutputStream outt - Object to writeout - OutputStream to be written toresponseProxy - ResponseProxy giving access to header and content length settersIOException - If an error occurs during writingEncodingException - if an errors occurs during encodingboolean supportsGZip(T t)
t - Object to writetrue, if GZip is supporteddefault MediaType getEncodedContentType(ResponseFormat responseFormat)
default boolean hasForcedHttpStatus(T t)
default HTTPStatus getForcedHttpStatus(T t)
Copyright © 2015–2020 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.