Class JStachioViewRenderer

java.lang.Object
io.jstach.opt.dropwizard.JStachioViewRenderer
All Implemented Interfaces:
io.dropwizard.views.common.ViewRenderer

public class JStachioViewRenderer extends Object implements 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 Details

  • Method Details

    • isRenderable

      public boolean isRenderable(io.dropwizard.views.common.View view)
      Specified by:
      isRenderable in interface io.dropwizard.views.common.ViewRenderer
    • render

      public void render(io.dropwizard.views.common.View view, Locale locale, OutputStream output) throws IOException
      Specified by:
      render in interface io.dropwizard.views.common.ViewRenderer
      Throws:
      IOException
    • jstachio

      protected JStachio jstachio()
      Internal getter for the jstachio backing this renderer
      Returns:
      not null
      Throws:
      NullPointerException - if jstachio has not been set yet.
    • configure

      public void configure(Map<String,String> options)
      Specified by:
      configure in interface io.dropwizard.views.common.ViewRenderer
    • getConfigurationKey

      public final String getConfigurationKey()
      Specified by:
      getConfigurationKey in interface io.dropwizard.views.common.ViewRenderer