Package gg.jte
Interface CodeResolver
-
public interface CodeResolverResponsible for resolving template code. Used by theTemplateEngineto transfer templates into native Java/Kotlin code. When running in production with precompiled templates, noCodeResolveris required.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanexists(java.lang.String name)Checks if a template with this name exists.longgetLastModified(java.lang.String name)Resolves the last modification time of a template.java.lang.Stringresolve(java.lang.String name)Resolves the code of a template.default java.util.List<java.lang.String>resolveAllTemplateNames()Resolves all template names thisCodeResolvercan resolve.
-
-
-
Method Detail
-
resolve
java.lang.String resolve(java.lang.String name)
Resolves the code of a template.- Parameters:
name- The name of the template, e.g."tag/util/card.jte".- Returns:
- The code of the resolved template, or
nullif no template with this name exists.
-
getLastModified
long getLastModified(java.lang.String name)
Resolves the last modification time of a template.- Parameters:
name- The name of the template, e.g."tag/util/card.jte".- Returns:
- The last modification time of this template in milliseconds, or
0Lif no template with this name exists. In case thisCodeResolverdoes not support modification times0Lshould be returned.
-
resolveAllTemplateNames
default java.util.List<java.lang.String> resolveAllTemplateNames()
Resolves all template names thisCodeResolvercan resolve.- Returns:
- A list of all existing templates.
- Throws:
java.lang.UnsupportedOperationException- in case this operation is not supported by this code resolver
-
exists
default boolean exists(java.lang.String name)
Checks if a template with this name exists.- Parameters:
name- The name of the template, e.g."tag/util/card.jte".- Returns:
trueif a template with this name exists, otherwise false.
-
-