Module com.azure.runtime.host
Interface TemplateEngine
public interface TemplateEngine
The template engine is responsible for processing templates, replacing placeholders with values from the context.
Templates can be processed from strings or from files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateEngine
Returns an instance of the template engine.default String
process
(InputStream templateStream, Map<String, Object> context) Processes the template file, replacing placeholders with values from the context.default List
<TemplateFileOutput> Processes the template files specified in the template descriptor list, using the context provided.Processes the template content, replacing placeholders with values from the context.
-
Method Details
-
getTemplateEngine
Returns an instance of the template engine.- Returns:
- An instance of the template engine.
-
process
default List<TemplateFileOutput> process(Class<?> cls, List<TemplateDescriptor> templateDescriptors, Map<String, Object> context) Processes the template files specified in the template descriptor list, using the context provided.- Parameters:
cls
- The class to use as the base for reading the template files.templateDescriptors
- The list of template descriptors to process.context
- The context to use when processing the templates.- Returns:
- A list of template file outputs.
-
process
Processes the template content, replacing placeholders with values from the context.- Parameters:
templateContent
- The template content to process.context
- The context to use when processing the template.- Returns:
- The processed template content.
-
process
Processes the template file, replacing placeholders with values from the context.- Parameters:
templateStream
- The template file to process.context
- The context to use when processing the template.- Returns:
- The processed template content.
-