java.lang.Object
io.jstach.opt.dropwizard.JStachioViewRenderer
- All Implemented Interfaces:
io.dropwizard.views.common.ViewRenderer
Dropwizard view support. Doing the below will automatically pick up JStachio
bootstrap.addBundle(new ViewBundle<>());
Or alternatively you can pass it directly:
JStachio jstachio = ...; // See JStachioFactory
bootstrap.addBundle(new ViewBundle<>(new JStachioViewRenderer(jstachio)));
- Author:
- agentgt
-
Constructor Summary
ConstructorDescriptionServiceLoader will call thisJStachioViewRenderer
(JStachio jstachio) Programmatically create the renderer with the given jstachio. -
Method Summary
Modifier and TypeMethodDescriptionvoid
final String
boolean
isRenderable
(io.dropwizard.views.common.View view) protected JStachio
jstachio()
Internal getter for the jstachio backing this renderervoid
render
(io.dropwizard.views.common.View view, Locale locale, OutputStream output)
-
Constructor Details
-
JStachioViewRenderer
public JStachioViewRenderer()ServiceLoader will call this -
JStachioViewRenderer
Programmatically create the renderer with the given jstachio.- Parameters:
jstachio
- a jstachio instance.- See Also:
-
-
Method Details
-
isRenderable
- Specified by:
isRenderable
in interfaceio.dropwizard.views.common.ViewRenderer
-
render
public void render(io.dropwizard.views.common.View view, Locale locale, OutputStream output) throws IOException - Specified by:
render
in interfaceio.dropwizard.views.common.ViewRenderer
- Throws:
IOException
-
jstachio
Internal getter for the jstachio backing this renderer- Returns:
- not null
- Throws:
NullPointerException
- if jstachio has not been set yet.
-
configure
- Specified by:
configure
in interfaceio.dropwizard.views.common.ViewRenderer
-
getConfigurationKey
- Specified by:
getConfigurationKey
in interfaceio.dropwizard.views.common.ViewRenderer
-