Package io.github.erdos.stencil
Interface PreparedTemplate
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface PreparedTemplate extends java.lang.AutoCloseable
Represents an already preprocessed template file.These files may be serialized or cached for later use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
Makes the template clean up any resources allocated for it.java.time.LocalDateTime
creationDateTime()
Time when the template was processed.java.io.File
getTemplateFile()
Original template file that was preprocessed.default TemplateDocumentFormats
getTemplateFormat()
Format of template file.TemplateVariables
getVariables()
Set of template variables found in file.EvaluatedDocument
render(java.util.Map<java.lang.String,PreparedFragment> fragments, FunctionEvaluator function, TemplateData templateData)
Renders the current prepared template file with the given template data.
-
-
-
Method Detail
-
getTemplateFile
java.io.File getTemplateFile()
Original template file that was preprocessed.- Returns:
- original template file
-
getTemplateFormat
default TemplateDocumentFormats getTemplateFormat()
Format of template file. Tries to guess from file name by default.
-
creationDateTime
java.time.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 interfacejava.lang.AutoCloseable
-
render
EvaluatedDocument render(java.util.Map<java.lang.String,PreparedFragment> fragments, FunctionEvaluator function, TemplateData templateData)
Renders the current prepared template file with the given template data.
-
-