public interface MessageEncoder
Modifier and Type | Field and Description |
---|---|
static MessageEncoder |
TO_STRING
To string renderer.
|
Modifier and Type | Method and Description |
---|---|
default MessageEncoder |
accept(MediaType contentType)
Execute this renderer only if the
Accept header matches the content-type
parameter. |
byte[] |
encode(Context ctx,
Object value)
MessageEncoder a value into a byte array or
null if given object isn't supported it. |
static final MessageEncoder TO_STRING
@Nonnull byte[] encode(@Nonnull Context ctx, @Nonnull Object value) throws Exception
null
if given object isn't supported it.ctx
- Web context.value
- Value to render.null
if given object isn't supported it.Exception
- If something goes wrong.@Nonnull default MessageEncoder accept(@Nonnull MediaType contentType)
Accept
header matches the content-type
parameter.contentType
- Mediatype to test.Copyright © 2020. All rights reserved.