public class HttpRendererContext extends AbstractRendererContext
charset
Constructor and Description |
---|
HttpRendererContext(Set<Renderer> renderers,
NativeResponse rsp,
Consumer<Long> len,
Consumer<MediaType> type,
Map<String,Object> locals,
List<MediaType> produces,
Charset charset) |
Modifier and Type | Method and Description |
---|---|
protected void |
_send(byte[] bytes) |
protected void |
_send(ByteBuffer buffer) |
protected void |
_send(FileChannel file) |
protected void |
_send(InputStream stream) |
Renderer.Context |
length(long length)
Set the
Content-Length header IF and ONLY IF, no Content-Length was
set yet. |
Renderer.Context |
type(MediaType type)
Set the
Content-Type header IF and ONLY IF, no Content-Type was set
yet. |
_send, accepts, charset, locals, render, send, send, send, send, send, send, send, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accepts, type
public Renderer.Context length(long length)
Renderer.Context
Content-Length
header IF and ONLY IF, no Content-Length
was
set yet.length
in interface Renderer.Context
length
in class AbstractRendererContext
length
- A suggested length to use if one is missing.public Renderer.Context type(MediaType type)
Renderer.Context
Content-Type
header IF and ONLY IF, no Content-Type
was set
yet.type
in interface Renderer.Context
type
in class AbstractRendererContext
type
- A suggested type to use if one is missing.protected void _send(ByteBuffer buffer) throws Exception
_send
in class AbstractRendererContext
Exception
protected void _send(byte[] bytes) throws Exception
_send
in class AbstractRendererContext
Exception
protected void _send(FileChannel file) throws Exception
_send
in class AbstractRendererContext
Exception
protected void _send(InputStream stream) throws Exception
_send
in class AbstractRendererContext
Exception
Copyright © 2015. All rights reserved.