Interface JStachioModelView

All Superinterfaces:
org.springframework.web.reactive.result.view.View

public interface JStachioModelView extends org.springframework.web.reactive.result.view.View
One way to use JStachio with Spring Webflux is to use this special View that will delegate to JStachio to render.

By default this view interface will use the static jstachio singleton which normally is the correct Spring wired version if configured correctly.

Author:
agentgt, dsyer
  • Field Summary

    Fields inherited from interface org.springframework.web.reactive.result.view.View

    BINDING_CONTEXT_ATTRIBUTE
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<org.springframework.http.MediaType>
     
    default JStachio
    Returns the jstachio singleton by default.
    default Object
    The model to be rendered by jstachio().
    of(Object model)
    Creates a spring view from a model
    default reactor.core.publisher.Mono<Void>
    render(Map<String,?> model, org.springframework.http.MediaType contentType, org.springframework.web.server.ServerWebExchange exchange)
     

    Methods inherited from interface org.springframework.web.reactive.result.view.View

    isRedirectView
  • Method Details

    • render

      default reactor.core.publisher.Mono<Void> render(Map<String,?> model, org.springframework.http.MediaType contentType, org.springframework.web.server.ServerWebExchange exchange)
      Specified by:
      render in interface org.springframework.web.reactive.result.view.View
    • getSupportedMediaTypes

      default List<org.springframework.http.MediaType> getSupportedMediaTypes()
      Specified by:
      getSupportedMediaTypes in interface org.springframework.web.reactive.result.view.View
    • jstachio

      default JStachio jstachio()
      Returns the jstachio singleton by default.
      Returns:
      stachio singleton by default.
      See Also:
    • model

      default Object model()
      The model to be rendered by jstachio().
      Returns:
      model defaulting to this instance.
    • of

      static JStachioModelView of(Object model)
      Creates a spring view from a model
      Parameters:
      model - an instance of a class annotated with JStache.
      Returns:
      view ready for rendering