Class JteViewsRenderer<T,R>

java.lang.Object
io.micronaut.views.jte.JteViewsRenderer<T,R>
Type Parameters:
T - type of input model.
R - type of request.
All Implemented Interfaces:
io.micronaut.core.order.Ordered, ViewsRenderer<T,R>
Direct Known Subclasses:
HtmlJteViewsRenderer, PlainJteViewsRenderer

public abstract class JteViewsRenderer<T,R> extends Object implements ViewsRenderer<T,R>
View renderer using JTE.
Since:
3.1.0
Author:
edward3h
  • Constructor Details

    • JteViewsRenderer

      protected JteViewsRenderer(ViewsConfiguration viewsConfiguration, JteViewsRendererConfiguration jteViewsRendererConfiguration, gg.jte.ContentType contentType, Path classDirectory)
      Parameters:
      viewsConfiguration - Views configuration
      jteViewsRendererConfiguration - JTE specific configuration
      contentType - JTE content type of this renderer
      classDirectory - When using dynamic templates, where to generate source and class files
  • Method Details

    • render

      @NonNull public @NonNull io.micronaut.core.io.Writable render(@NonNull @NonNull String viewName, @Nullable T data, @Nullable R request)
      Specified by:
      render in interface ViewsRenderer<T,R>
      Parameters:
      viewName - view name to be rendered
      data - response body to render it with a view
      request - HTTP request
      Returns:
      A writable where the view will be written to.
    • exists

      public boolean exists(@NonNull @NonNull String viewName)
      Specified by:
      exists in interface ViewsRenderer<T,R>
      Parameters:
      viewName - view name to be rendered
      Returns:
      true if a template can be found for the supplied view name.