public class AbstractServiceResponseWriter extends AbstractResponseWriter<AbstractServiceResponse>
Constructor and Description |
---|
AbstractServiceResponseWriter() |
Modifier and Type | Method and Description |
---|---|
private MediaType |
getEncodedContentType(AbstractServiceResponse asr) |
private Encoder<Object,AbstractServiceResponse> |
getEncoder(AbstractServiceResponse asr)
Get the
Encoder for the AbstractServiceResponse and the
requested contentType |
private boolean |
isStreaming(AbstractServiceResponse asr)
Check if streaming encoding is forced and the
Encoder for the
AbstractServiceResponse is a StreamingEncoder |
boolean |
supportsGZip(AbstractServiceResponse asr)
Check if GZip is supported by this writer
|
void |
write(AbstractServiceResponse asr,
OutputStream out,
ResponseProxy responseProxy)
Write object t to
OutputStream out |
getContentType, getEncodedContentType, getEncoder, isSetContentType, setContentType
public void write(AbstractServiceResponse asr, OutputStream out, ResponseProxy responseProxy) throws IOException
ResponseWriter
OutputStream
outasr
- Object to writeout
- OutputStream
to be written toresponseProxy
- ResponseProxy
giving access to header and content length settersIOException
- If an error occurs during writingpublic boolean supportsGZip(AbstractServiceResponse asr)
ResponseWriter
asr
- Object to writetrue
, if GZip is supportedprivate Encoder<Object,AbstractServiceResponse> getEncoder(AbstractServiceResponse asr)
Encoder
for the AbstractServiceResponse
and the
requested contentTypeasr
- AbstractServiceResponse
to get Encoder
forEncoder
for the AbstractServiceResponse
private MediaType getEncodedContentType(AbstractServiceResponse asr)
private boolean isStreaming(AbstractServiceResponse asr)
Encoder
for the
AbstractServiceResponse
is a StreamingEncoder
asr
- AbstractServiceResponse
to check the Encoder
fortrue
, if streaming encoding is forced and the
Encoder
for the AbstractServiceResponse
is a
StreamingEncoder
Copyright © 2012-2015 52north.org. All Rights Reserved.