Class AbstractStreamTemplateSet<T extends OutputStream>

java.lang.Object
io.inverno.mod.irt.AbstractTemplateSet
io.inverno.mod.irt.AbstractStreamTemplateSet<T>
Type Parameters:
T - The type of OutputStream
All Implemented Interfaces:
TemplateSet

public abstract class AbstractStreamTemplateSet<T extends OutputStream> extends AbstractTemplateSet

A TemplateSet base implementation template sets which renders data in an OutputStream.

Since:
1.2
Author:
Jeremy Kuhn
  • Constructor Details

    • AbstractStreamTemplateSet

      public AbstractStreamTemplateSet(Charset charset, T output)

      Creates a Stream template set.

      Parameters:
      charset - the charset to use to encode data
      output - the output stream where to write rendered data
  • Method Details

    • getOutput

      public T getOutput()

      Returns the output stream where rendered data are written.

      Returns:
      an output stream
    • render

      public CompletableFuture<Void> render(String value)
      Description copied from interface: TemplateSet

      Renders a string to the output.

      Parameters:
      value - the string to render
      Returns:
      a future which completes once the value is rendered
    • render

      public CompletableFuture<Void> render(byte[] value)
      Description copied from interface: TemplateSet

      Renders a byte array to the output.

      Parameters:
      value - The byte array to render
      Returns:
      a future which completes once the value is rendered