Package io.micronaut.views.turbo
Class DefaultTurboStreamRenderer
java.lang.Object
io.micronaut.views.turbo.DefaultTurboStreamRenderer
- All Implemented Interfaces:
TurboStreamRenderer
@Singleton
@Requires(classes=io.micronaut.http.HttpRequest.class)
public class DefaultTurboStreamRenderer
extends Object
implements TurboStreamRenderer
DefaultImplementation
of TurboStreamRenderer
.- Since:
- 3.3.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultTurboStreamRenderer
(ViewsRendererLocator viewsRendererLocator) Deprecated, for removal: This API element is subject to removal in a future version.DefaultTurboStreamRenderer
(ViewsRendererLocator viewsRendererLocator, ViewsModelDecorator viewsModelDecorator) -
Method Summary
Modifier and TypeMethodDescription@NonNull Optional<io.micronaut.core.io.Writable>
render
(TurboStream.Builder builder, @Nullable io.micronaut.http.HttpRequest<?> request)
-
Field Details
-
viewsRendererLocator
-
-
Constructor Details
-
DefaultTurboStreamRenderer
@Inject public DefaultTurboStreamRenderer(ViewsRendererLocator viewsRendererLocator, ViewsModelDecorator viewsModelDecorator) - Parameters:
viewsRendererLocator
- ViewRendererLocatorviewsModelDecorator
- Views Model Decorator
-
DefaultTurboStreamRenderer
@Deprecated(since="5.2.1", forRemoval=true) public DefaultTurboStreamRenderer(ViewsRendererLocator viewsRendererLocator) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
viewsRendererLocator
- View Renderer Locator
-
-
Method Details
-
render
@NonNull public @NonNull Optional<io.micronaut.core.io.Writable> render(@NonNull TurboStream.Builder builder, @Nullable @Nullable io.micronaut.http.HttpRequest<?> request) - Specified by:
render
in interfaceTurboStreamRenderer
- Parameters:
builder
- Turbo Stream builderrequest
- HTTP Request- Returns:
- A Writable
-
DefaultTurboStreamRenderer(ViewsRendererLocator, ViewsModelDecorator)
instead.