Module io.jstach.opt.spring.webflux
Package io.jstach.opt.spring.webflux
Interface JStachioModelView
- All Superinterfaces:
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 TypeMethodDescriptiondefault int
The initial size of the buffer allocated to be used for rendering.default JStachio
jstachio()
Returns the jstachio singleton by default.default MediaType
The default media type for the view.default Object
model()
The model to be rendered byjstachio()
.static JStachioModelView
Creates a spring view from a modeldefault reactor.core.publisher.Mono<Void>
render
(@Nullable Map<String, ?> model, @Nullable MediaType contentType, ServerWebExchange exchange) Methods inherited from interface org.springframework.web.reactive.result.view.View
isRedirectView
-
Method Details
-
render
-
getSupportedMediaTypes
- Specified by:
getSupportedMediaTypes
in interfaceView
-
jstachio
Returns the jstachio singleton by default.- Returns:
- stachio singleton by default.
- See Also:
-
model
The model to be rendered byjstachio()
.- Returns:
- model defaulting to
this
instance.
-
bufferSize
The initial size of the buffer allocated to be used for rendering.- Returns:
- buffer size the default is 4K.
-
mediaType
The default media type for the view.- Returns:
- media type the default is "
text/html; charset=UTF-8
"
-
of
Creates a spring view from a model- Parameters:
model
- an instance of a class annotated withJStache
.- Returns:
- view ready for rendering
-