Interface Template


public interface Template
Template. Instances are obtained from a TemplateProvider.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    apply(Object input)
     
    void
    apply(Object input, Appendable output)
    Applies the template to the given input data and writes the result to the output.
    Returns the URL of the template's origin.
  • Method Details

    • origin

      Returns the URL of the template's origin.

      This could be a file path, an HTTP URL, a classpath resource, etc.

    • apply

      void apply(Object input, Appendable output) throws IOException
      Applies the template to the given input data and writes the result to the output.
      Parameters:
      input - The data to be used by the template.
      output - The Appendable to which the rendered template content will be written.
      Throws:
      IOException - If an I/O error occurs during template rendering. Including an error specific to template processing occurs (e.g. syntax error, data model mismatch, missing helper).
    • apply

      default String apply(Object input) throws IOException
      Throws:
      IOException