11package io .github .erdos .stencil ;
22
3+ import io .github .erdos .stencil .functions .FunctionEvaluator ;
4+
35import java .io .File ;
46import java .time .LocalDateTime ;
7+ import java .util .Map ;
58
69/**
710 * Represents an already preprocessed template file.
811 * <p>
912 * These files may be serialized or cached for later use.
1013 */
1114@ SuppressWarnings ("unused" )
12- public interface PreparedTemplate extends AutoCloseable {
15+ public interface PreparedTemplate extends AutoCloseable {
1316
1417 /**
1518 * Original template file that was preprocessed.
@@ -32,16 +35,7 @@ default TemplateDocumentFormats getTemplateFormat() {
3235 *
3336 * @return template preprocess call time
3437 */
35- LocalDateTime creationDateTime ();
36-
37- /**
38- * Contains the preprocess result.
39- * <p>
40- * Implementation detail. May be used for serializing these objects. May be used for debugging too.
41- *
42- * @return inner representation of prepared template
43- */
44- Object getSecretObject ();
38+ LocalDateTime creationDateTime (); // TODO: remove?
4539
4640
4741 /**
@@ -50,20 +44,15 @@ default TemplateDocumentFormats getTemplateFormat() {
5044 TemplateVariables getVariables ();
5145
5246 /**
53- * Makes the template clean up any resources allocated for it. Subsequential invocations of this method have no
54- * effects. Rendering the template after this method call will throw an IllegalStateException.
47+ * Makes the template clean up any resources allocated for it.
48+ * Subsequent invocations of this method have no effects.
49+ * Rendering the template after this method call will throw an IllegalStateException.
5550 */
56- void cleanup ();
51+ @ Override
52+ void close ();
5753
5854 /**
5955 * Renders the current prepared template file with the given template data.
6056 */
61- default EvaluatedDocument render (TemplateData templateData ) {
62- return API .render (this , templateData );
63- }
64-
65- @ Override
66- default void close () {
67- cleanup ();
68- }
57+ EvaluatedDocument render (Map <String , PreparedFragment > fragments , FunctionEvaluator function , TemplateData templateData );
6958}
0 commit comments