Package io.micronaut.views
Class TemplatedBuilder<T extends Renderable,SELF extends TemplatedBuilder<T,SELF>>
java.lang.Object
io.micronaut.views.TemplatedBuilder<T,SELF>
- Type Parameters:
T- The class to be builtSELF- The builder itself (so that it can be chained)
- Direct Known Subclasses:
TurboFrame.Builder
public abstract class TemplatedBuilder<T extends Renderable,SELF extends TemplatedBuilder<T,SELF>>
extends Object
Abstract class to be used by builders which support templates.
- Since:
- 3.4.0
- Author:
- Sergio del Amo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Tbuild()@Nullable Object@NonNull SELFtemplate(@NonNull io.micronaut.core.io.Writable writable) Sets the Turbo frame content with aWritable.@NonNull SELFtemplate(@NonNull CharSequence html) Sets the Turbo Frame with a String.@NonNull SELFSets the template with a View and Model.@NonNull SELFtemplateModel(@NonNull Object templateModel) Sets the template's model.@NonNull SELFtemplateView(@NonNull String templateView) Sets the template's view name.
-
Constructor Details
-
TemplatedBuilder
public TemplatedBuilder()
-
-
Method Details
-
build
- Returns:
- Build instance
-
getTemplateView
- Returns:
- The TurboStream template view name.
-
getTemplateModel
- Returns:
- The TurboStream template model.
-
getTemplate
- Returns:
- The Template
-
template
Sets the template with a View and Model.- Parameters:
view- The View namemodel- The Model- Returns:
- The Builder
-
template
Sets the Turbo Frame with a String. E.g. HTML.- Parameters:
html- The turbo frame content- Returns:
- The Builder
-
template
Sets the Turbo frame content with aWritable.- Parameters:
writable- The template as aWritable.- Returns:
- The Builder
-
templateView
Sets the template's view name.- Parameters:
templateView- The View name- Returns:
- The Builder
-
templateModel
Sets the template's model.- Parameters:
templateModel- template model.- Returns:
- The Builder
-