Package io.dropwizard.views.common
Interface ViewRenderer
-
- All Known Implementing Classes:
FreemarkerViewRenderer,MustacheViewRenderer
public interface ViewRendererThe rendering engine for a type of view.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconfigure(Map<String,String> options)options for configuring the view rendererStringgetConfigurationKey()booleanisRenderable(View view)Returnstrueif the renderer can render the givenView.voidrender(View view, Locale locale, OutputStream output)
-
-
-
Method Detail
-
isRenderable
boolean isRenderable(View view)
Returnstrueif the renderer can render the givenView.- Parameters:
view- a view- Returns:
trueifviewcan be rendered
-
render
void render(View view, Locale locale, OutputStream output) throws IOException
- Parameters:
view- a viewlocale- the locale in which the view should be renderedoutput- the output stream- Throws:
IOException- if there is an error writing tooutputjakarta.ws.rs.WebApplicationException- if there is an error rendering the template
-
configure
void configure(Map<String,String> options)
options for configuring the view renderer- Parameters:
options-
-
getConfigurationKey
String getConfigurationKey()
- Returns:
- the key to use in the view configurations, i.e. 'freemarker' or 'mustache'.
-
-