Package io.github.erdos.stencil
Interface PreparedTemplate
- All Superinterfaces:
AutoCloseable
Represents an already preprocessed template file.
These files may be serialized or cached for later use.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Makes the template clean up any resources allocated for it.Time when the template was processed.Original template file that was preprocessed.default TemplateDocumentFormats
Format of template file.Set of template variables found in file.render
(Map<String, PreparedFragment> fragments, FunctionEvaluator function, TemplateData templateData) Renders the current prepared template file with the given template data.
-
Method Details
-
getTemplateFile
File getTemplateFile()Original template file that was preprocessed.- Returns:
- original template file
-
getTemplateFormat
Format of template file. Tries to guess from file name by default. -
creationDateTime
LocalDateTime creationDateTime()Time when the template was processed.- Returns:
- template preprocess call time
-
getVariables
TemplateVariables getVariables()Set of template variables found in file. -
close
void close()Makes the template clean up any resources allocated for it. Subsequent invocations of this method have no effects. Rendering the template after this method call will throw an IllegalStateException.- Specified by:
close
in interfaceAutoCloseable
-
render
EvaluatedDocument render(Map<String, PreparedFragment> fragments, FunctionEvaluator function, TemplateData templateData) Renders the current prepared template file with the given template data.
-