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 Summary
Modifier and TypeMethodDescriptionvoid
Evaluate the template without any provided variables.void
Evaluate the template with a particular locale but without any provided variables.void
Evaluate the template with a set of variables and the default locale provided by thePebbleEngine
void
Evaluate the template with a particular locale and a set of variables.void
evaluateBlock
(String blockName, Writer writer) Evaluate the template but only render the contents of a specific block.void
evaluateBlock
(String blockName, Writer writer, Locale locale) Evaluate the template but only render the contents of a specific block.void
Evaluate the template but only render the contents of a specific block.void
Evaluate the template but only render the contents of a specific block.getName()
Returns the name of the template
-
Method Details
-
evaluate
Evaluate the template without any provided variables. This will use the default locale provided by thePebbleEngine
.- Parameters:
writer
- The results of the evaluation are written to this writer.- Throws:
IOException
- An IO exception during the evaluation
-
evaluate
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
Evaluate the template with a set of variables and the default locale provided by thePebbleEngine
- 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
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
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
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
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 IOExceptionEvaluate 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
-