java.lang.Object
io.inverno.mod.irt.AbstractTemplateSet
io.inverno.mod.irt.AbstractStringPublisherTemplateSet
- All Implemented Interfaces:
PublisherTemplateSet<String>
,TemplateSet
public abstract class AbstractStringPublisherTemplateSet
extends AbstractTemplateSet
implements PublisherTemplateSet<String>
A TemplateSet
base implementation template sets which renders data in
a reactive way using a String sink.
This implementation allows to process rendered data without waiting for the whole data set to be rendered or even available following reactive programming principles.
- Since:
- 1.2
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.inverno.mod.irt.TemplateSet
TemplateSet.IndexableRenderable<T>, TemplateSet.Renderable<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Sinks.Many
<String> The String sink where rendered data are publishedFields inherited from class io.inverno.mod.irt.AbstractTemplateSet
charset
Fields inherited from interface io.inverno.mod.irt.TemplateSet
COMPLETED_FUTURE
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a String publisher template set. -
Method Summary
Methods inherited from class io.inverno.mod.irt.AbstractTemplateSet
applyTemplate, applyTemplate, applyTemplate, applyTemplate, applyTemplate, render
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.irt.TemplateSet
applyTemplate, applyTemplate, applyTemplate, applyTemplate, applyTemplate, render, template
-
Field Details
-
sink
The String sink where rendered data are published
-
-
Constructor Details
-
AbstractStringPublisherTemplateSet
Creates a String publisher template set.
- Parameters:
charset
- the charset to use to encode data
-
-
Method Details
-
getSink
Description copied from interface:PublisherTemplateSet
Returns the sink where rendered data are published.
- Specified by:
getSink
in interfacePublisherTemplateSet<String>
- Returns:
- the sink
-
render
Description copied from interface:TemplateSet
Renders a string to the output.
- Specified by:
render
in interfaceTemplateSet
- Parameters:
value
- the string to render- Returns:
- a future which completes once the value is rendered
-
render
Description copied from interface:TemplateSet
Renders a byte array to the output.
- Specified by:
render
in interfaceTemplateSet
- Parameters:
value
- The byte array to render- Returns:
- a future which completes once the value is rendered
-