java.lang.Object
io.inverno.mod.irt.AbstractTemplateSet
io.inverno.mod.irt.AbstractByteBufPublisherTemplateSet
- All Implemented Interfaces:
ByteBufTemplateSet,PublisherTemplateSet<ByteBuf>,TemplateSet
public abstract class AbstractByteBufPublisherTemplateSet
extends AbstractTemplateSet
implements PublisherTemplateSet<ByteBuf>, ByteBufTemplateSet
A TemplateSet base implementation template sets which renders data in a reactive way using a ByteBuf 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
FieldsModifier and TypeFieldDescriptionprotected final Sinks.Many<ByteBuf> The ByteBuf sink where rendered data are publishedFields inherited from class io.inverno.mod.irt.AbstractTemplateSet
charsetFields inherited from interface io.inverno.mod.irt.TemplateSet
COMPLETED_FUTURE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a ByteBuf publisher template set. -
Method Summary
Methods inherited from class io.inverno.mod.irt.AbstractTemplateSet
applyTemplate, applyTemplate, applyTemplate, applyTemplate, applyTemplateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.irt.TemplateSet
applyTemplate, applyTemplate, applyTemplate, applyTemplate, applyTemplate, template
-
Field Details
-
sink
The ByteBuf sink where rendered data are published
-
-
Constructor Details
-
AbstractByteBufPublisherTemplateSet
Creates a ByteBuf publisher template set.
- Parameters:
charset- the charset to use to encode data
-
-
Method Details
-
getSink
Description copied from interface:PublisherTemplateSetReturns the sink where rendered data are published.
- Specified by:
getSinkin interfacePublisherTemplateSet<ByteBuf>- Returns:
- the sink
-
render
Description copied from interface:TemplateSetRenders an object to the output.
This method might invoke specialized methods based on the actual type of the object. If no specific method is found the string representation of the object must be rendered.
- Specified by:
renderin interfaceTemplateSet- Overrides:
renderin classAbstractTemplateSet- Parameters:
value- the object to render- Returns:
- a future which completes once the value is rendered
-
render
Description copied from interface:ByteBufTemplateSetRenders a ByteBuf to the output.
- Specified by:
renderin interfaceByteBufTemplateSet- Parameters:
value- the ByteBuf to render- Returns:
- a future which completes once the value is rendered
-
render
Description copied from interface:TemplateSetRenders a string to the output.
- Specified by:
renderin interfaceTemplateSet- Parameters:
value- the string to render- Returns:
- a future which completes once the value is rendered
-
render
Description copied from interface:TemplateSetRenders a byte array to the output.
- Specified by:
renderin interfaceTemplateSet- Parameters:
value- The byte array to render- Returns:
- a future which completes once the value is rendered
-