Interface PebbleTemplate
-
- All Known Implementing Classes:
PebbleTemplateImpl
public interface PebbleTemplateA template object constructed by an instance ofPebbleEngine. 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidevaluate(java.io.Writer writer)Evaluate the template without any provided variables.voidevaluate(java.io.Writer writer, java.util.Locale locale)Evaluate the template with a particular locale but without any provided variables.voidevaluate(java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context)Evaluate the template with a set of variables and the default locale provided by thePebbleEnginevoidevaluate(java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context, java.util.Locale locale)Evaluate the template with a particular locale and a set of variables.voidevaluateBlock(java.lang.String blockName, java.io.Writer writer)Evaluate the template but only render the contents of a specific block.voidevaluateBlock(java.lang.String blockName, java.io.Writer writer, java.util.Locale locale)Evaluate the template but only render the contents of a specific block.voidevaluateBlock(java.lang.String blockName, java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context)Evaluate the template but only render the contents of a specific block.voidevaluateBlock(java.lang.String blockName, java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context, java.util.Locale locale)Evaluate the template but only render the contents of a specific block.java.lang.StringgetName()Returns the name of the template
-
-
-
Method Detail
-
evaluate
void evaluate(java.io.Writer writer) throws java.io.IOExceptionEvaluate 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:
java.io.IOException- An IO exception during the evaluation
-
evaluate
void evaluate(java.io.Writer writer, java.util.Locale locale) throws java.io.IOExceptionEvaluate 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:
java.io.IOException- An IO exception during the evaluation
-
evaluate
void evaluate(java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.IOExceptionEvaluate 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:
java.io.IOException- An IO exception during the evaluation
-
evaluate
void evaluate(java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context, java.util.Locale locale) throws java.io.IOExceptionEvaluate 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:
java.io.IOException- An IO exception during the evaluation
-
evaluateBlock
void evaluateBlock(java.lang.String blockName, java.io.Writer writer) throws java.io.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.- Throws:
java.io.IOException- An IO exception during the evaluation
-
evaluateBlock
void evaluateBlock(java.lang.String blockName, java.io.Writer writer, java.util.Locale locale) throws java.io.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.locale- The locale used during the evaluation of the template.- Throws:
java.io.IOException- An IO exception during the evaluation
-
evaluateBlock
void evaluateBlock(java.lang.String blockName, java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.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.- Throws:
java.io.IOException- An IO exception during the evaluation
-
evaluateBlock
void evaluateBlock(java.lang.String blockName, java.io.Writer writer, java.util.Map<java.lang.String,java.lang.Object> context, java.util.Locale locale) throws java.io.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:
java.io.IOException- An IO exception during the evaluation
-
getName
java.lang.String getName()
Returns the name of the template- Returns:
- The name of the template
-
-