
net.javapla.jawn.core.Renderer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jawn-core Show documentation
Show all versions of jawn-core Show documentation
java-web-planet / jawn - A simple web framework in Java
The newest version!
package net.javapla.jawn.core;
/**
* Rendering of responses
*
*/
public interface Renderer {
// Renderer TO_STRING = (ctx, value) -> {
// if (ctx.req().accepts(MediaType.PLAIN/*ctx.resp().contentType()*/)) {
// return value.toString().getBytes(ctx.resp().charset());
// }
// throw Up.NotAcceptable(ctx.req().header("Accept").value());
// };
/**
*
* @param ctx
* @param value
* @return null
if the response has been handled by the renderer
* @throws Exception
*/
byte[] render(Context ctx, Object value) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy