Interface PebbleTemplate

All Known Implementing Classes:
PebbleTemplateImpl

public interface PebbleTemplate
A template object constructed by an instance of PebbleEngine. A template by itself is stateless and can therefore be re-used over and over to provide different outputs depending on the variables that are provided at the time of evaluation.
  • Method Details

    • evaluate

      void evaluate(Writer writer) throws IOException
      Evaluate the template without any provided variables. This will use the default locale provided by the PebbleEngine.
      Parameters:
      writer - The results of the evaluation are written to this writer.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluate

      void evaluate(Writer writer, Locale locale) throws IOException
      Evaluate the template with a particular locale but without any provided variables.
      Parameters:
      writer - The results of the evaluation are written to this writer.
      locale - The locale used during the evaluation of the template.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluate

      void evaluate(Writer writer, Map<String,Object> context) throws IOException
      Evaluate the template with a set of variables and the default locale provided by the PebbleEngine
      Parameters:
      writer - The results of the evaluation are written to this writer.
      context - The variables used during the evaluation of the template.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluate

      void evaluate(Writer writer, Map<String,Object> context, Locale locale) throws IOException
      Evaluate the template with a particular locale and a set of variables.
      Parameters:
      writer - The results of the evaluation are written to this writer.
      context - The variables used during the evaluation of the template.
      locale - The locale used during the evaluation of the template.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluateBlock

      void evaluateBlock(String blockName, Writer writer) throws IOException
      Evaluate the template but only render the contents of a specific block.
      Parameters:
      blockName - The name of the template block to return.
      writer - The results of the evaluation are written to this writer.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluateBlock

      void evaluateBlock(String blockName, Writer writer, Locale locale) throws IOException
      Evaluate the template but only render the contents of a specific block.
      Parameters:
      blockName - The name of the template block to return.
      writer - The results of the evaluation are written to this writer.
      locale - The locale used during the evaluation of the template.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluateBlock

      void evaluateBlock(String blockName, Writer writer, Map<String,Object> context) throws IOException
      Evaluate the template but only render the contents of a specific block.
      Parameters:
      blockName - The name of the template block to return.
      writer - The results of the evaluation are written to this writer.
      context - The variables used during the evaluation of the template.
      Throws:
      IOException - An IO exception during the evaluation
    • evaluateBlock

      void evaluateBlock(String blockName, Writer writer, Map<String,Object> context, Locale locale) throws IOException
      Evaluate the template but only render the contents of a specific block.
      Parameters:
      blockName - The name of the template block to return.
      writer - The results of the evaluation are written to this writer.
      context - The variables used during the evaluation of the template.
      locale - The locale used during the evaluation of the template.
      Throws:
      IOException - An IO exception during the evaluation
    • getName

      String getName()
      Returns the name of the template
      Returns:
      The name of the template