Module io.jooby
Package io.jooby

Interface MessageEncoder

All Known Subinterfaces:
TemplateEngine

public interface MessageEncoder
Render a route output as byte array.
Since:
2.0.0
Author:
edgar
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MessageEncoder
    To string renderer.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    encode(Context ctx, Object value)
    MessageEncoder a value into a byte array or null if given object isn't supported it.
  • Field Details

    • TO_STRING

      static final MessageEncoder TO_STRING
      To string renderer.
  • Method Details

    • encode

      @Nullable byte[] encode(@NonNull Context ctx, @NonNull Object value) throws Exception
      MessageEncoder a value into a byte array or null if given object isn't supported it.
      Parameters:
      ctx - Web context.
      value - Value to render.
      Returns:
      Value as byte array or null if given object isn't supported it.
      Throws:
      Exception - If something goes wrong.